-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:bitwarden/sdk into feature/wasm
# Conflicts: # .gitignore # crates/bitwarden/src/auth/renew.rs # crates/bitwarden/src/client/client.rs # languages/js_webassembly/package-lock.json
- Loading branch information
Showing
184 changed files
with
7,799 additions
and
561 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: Build Java SDK | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
generate_schemas: | ||
uses: ./.github/workflows/generate_schemas.yml | ||
|
||
build_rust: | ||
uses: ./.github/workflows/build-rust-cross-platform.yml | ||
|
||
build_java: | ||
name: Build Java | ||
runs-on: ubuntu-22.04 | ||
needs: | ||
- generate_schemas | ||
- build_rust | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
||
- name: Download Java schemas artifact | ||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | ||
with: | ||
name: sdk-schemas-java | ||
path: languages/java/src/main/java/bit/sdk/schema/ | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
|
||
- name: Download x86_64-apple-darwin files | ||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | ||
with: | ||
name: libbitwarden_c_files-x86_64-apple-darwin | ||
path: languages/java/src/main/resources/darwin-x64 | ||
|
||
- name: Download aarch64-apple-darwin files | ||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | ||
with: | ||
name: libbitwarden_c_files-aarch64-apple-darwin | ||
path: languages/java/src/main/resources/darwin-aarch64 | ||
|
||
- name: Download x86_64-unknown-linux-gnu files | ||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | ||
with: | ||
name: libbitwarden_c_files-x86_64-unknown-linux-gnu | ||
path: languages/java/src/main/resources/ubuntu-x64 | ||
|
||
- name: Download x86_64-pc-windows-msvc files | ||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | ||
with: | ||
name: libbitwarden_c_files-x86_64-pc-windows-msvc | ||
path: languages/java/src/main/resources/windows-x64 | ||
|
||
- name: Publish Maven | ||
uses: gradle/gradle-build-action@87a9a15658c426a54dd469d4fc7dc1a73ca9d4a6 # v2.10.0 | ||
with: | ||
arguments: publish | ||
build-root-directory: languages/java | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: Go Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version_number: | ||
description: "New Version" | ||
required: true | ||
|
||
env: | ||
GO111MODULE: on | ||
GO_VERSION: "^1.18" | ||
|
||
jobs: | ||
build_rust: | ||
uses: ./.github/workflows/build-rust-cross-platform.yml | ||
|
||
generate-schemas: | ||
uses: ./.github/workflows/generate_schemas.yml | ||
|
||
build: | ||
name: Build | ||
needs: | ||
- build_rust | ||
- generate-schemas | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
||
- name: Setup Go environment | ||
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Build | ||
run: go build -v ./... | ||
|
||
- name: Test | ||
run: go test -v ./... | ||
|
||
release: | ||
name: Release | ||
needs: build | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
||
- name: Setup Go environment | ||
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
|
||
- name: Set release version | ||
run: echo "VERSION=${{ github.event.inputs.version_number }}" >> $GITHUB_ENV | ||
|
||
- name: Install Goreleaser | ||
run: go install github.com/goreleaser/[email protected] | ||
|
||
- name: Run Goreleaser | ||
run: goreleaser release --rm-dist --skip-validate | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
VERSION: ${{ env.VERSION }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Publish PHP SDK | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build_rust: | ||
uses: ./.github/workflows/build-rust-cross-platform.yml | ||
|
||
setup_php: | ||
name: Setup PHP | ||
runs-on: ubuntu-22.04 | ||
needs: | ||
- build_rust | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
||
- name: Setup PHP with PECL extension | ||
uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35 # 2.28.0 | ||
with: | ||
php-version: "8.0" | ||
tools: composer | ||
extensions: ext-ffi | ||
|
||
- name: Composer check | ||
run: | | ||
composer install | ||
composer validate | ||
working-directory: languages/php/ | ||
|
||
- name: Download x86_64-apple-darwin files | ||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | ||
with: | ||
name: libbitwarden_c_files-x86_64-apple-darwin | ||
path: temp/macos-x64 | ||
|
||
- name: Download aarch64-apple-darwin files | ||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | ||
with: | ||
name: libbitwarden_c_files-aarch64-apple-darwin | ||
path: temp/macos-arm64 | ||
|
||
- name: Download x86_64-unknown-linux-gnu files | ||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | ||
with: | ||
name: libbitwarden_c_files-x86_64-unknown-linux-gnu | ||
path: temp/ubuntu-x64 | ||
|
||
- name: Download x86_64-pc-windows-msvc files | ||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | ||
with: | ||
name: libbitwarden_c_files-x86_64-pc-windows-msvc | ||
path: temp/windows-x64 | ||
|
||
- name: Copy lib files | ||
run: | | ||
mkdir -p languages/php/src/lib/macos-arm64 | ||
mkdir -p languages/php/src/lib/ubuntu-x64 | ||
mkdir -p languages/php/src/lib/macos-x64 | ||
mkdir -p languages/php/src/lib/windows-x64 | ||
platforms=("macos-arm64" "ubuntu-x64" "macos-x64" "windows-x64") | ||
files=("libbitwarden_c.dylib" "libbitwarden_c.so" "libbitwarden_c.dylib" "bitwarden_c.dll") | ||
for ((i=0; i<${#platforms[@]}; i++)); do | ||
cp "temp/${platforms[$i]}/${files[$i]}" "languages/php/src/lib/${platforms[$i]}/${files[$i]}" | ||
done | ||
- name: Publish version | ||
run: curl -XPOST -H'content-type:application/json' 'https://packagist.org/api/update-package?username=malirobot&apiToken=${{secrets.PACKAGIST_KEY}}' -d'{"repository":{"url":"https://packagist.org/packages/bitwarden/sdk"}}' | ||
working-directory: languages/php/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
name: Publish Ruby SDK | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
generate_schemas: | ||
uses: ./.github/workflows/generate_schemas.yml | ||
|
||
build_rust: | ||
uses: ./.github/workflows/build-rust-cross-platform.yml | ||
|
||
build_ruby: | ||
name: Build Ruby | ||
runs-on: ubuntu-22.04 | ||
needs: | ||
- generate_schemas | ||
- build_rust | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@8575951200e472d5f2d95c625da0c7bec8217c42 # v1.161.0 | ||
with: | ||
ruby-version: 3.2 | ||
|
||
- name: Download Ruby schemas artifact | ||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | ||
with: | ||
name: schemas.rb | ||
path: languages/ruby/bitwarden_sdk/lib | ||
|
||
- name: Download x86_64-apple-darwin files | ||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | ||
with: | ||
name: libbitwarden_c_files-x86_64-apple-darwin | ||
path: temp/macos-x64 | ||
|
||
- name: Download aarch64-apple-darwin files | ||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | ||
with: | ||
name: libbitwarden_c_files-aarch64-apple-darwin | ||
path: temp/macos-arm64 | ||
|
||
- name: Download x86_64-unknown-linux-gnu files | ||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | ||
with: | ||
name: libbitwarden_c_files-x86_64-unknown-linux-gnu | ||
path: temp/ubuntu-x64 | ||
|
||
- name: Download x86_64-pc-windows-msvc files | ||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | ||
with: | ||
name: libbitwarden_c_files-x86_64-pc-windows-msvc | ||
path: temp/windows-x64 | ||
|
||
- name: Copy lib files | ||
run: | | ||
mkdir -p languages/ruby/bitwarden_sdk/lib/macos-arm64 | ||
mkdir -p languages/ruby/bitwarden_sdk/lib/ubuntu-x64 | ||
mkdir -p languages/ruby/bitwarden_sdk/lib/macos-x64 | ||
mkdir -p languages/ruby/bitwarden_sdk/lib/windows-x64 | ||
platforms=("macos-arm64" "ubuntu-x64" "macos-x64" "windows-x64") | ||
files=("libbitwarden_c.dylib" "libbitwarden_c.so" "libbitwarden_c.dylib" "bitwarden_c.dll") | ||
for ((i=0; i<${#platforms[@]}; i++)); do | ||
cp "temp/${platforms[$i]}/${files[$i]}" "languages/ruby/bitwarden_sdk/lib/${platforms[$i]}/${files[$i]}" | ||
done | ||
shell: bash | ||
|
||
- name: Build gem | ||
run: gem build bitwarden-sdk.gemspec | ||
working-directory: languages/ruby/bitwarden_sdk | ||
|
||
- name: Push gem to Rubygems | ||
run: | | ||
mkdir -p $HOME/.gem | ||
touch $HOME/.gem/credentials | ||
chmod 0600 $HOME/.gem/credentials | ||
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials | ||
gem push *.gem | ||
env: | ||
GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }} | ||
working-directory: languages/ruby/bitwarden_sdk |
Oops, something went wrong.