Skip to content

Commit

Permalink
Merge branch 'main' of github.com:bitwarden/sdk into ps/allocator
Browse files Browse the repository at this point in the history
# Conflicts:
#	crates/memory-testing/src/main.rs
  • Loading branch information
Hinton committed May 23, 2024
2 parents 4ab4af7 + 5d8536b commit 3605dbb
Show file tree
Hide file tree
Showing 30 changed files with 363 additions and 181 deletions.
89 changes: 75 additions & 14 deletions .github/workflows/release-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
_BOT_EMAIL: 106330231+bitwarden-devops-bot@users.noreply.github.com
_BOT_NAME: bitwarden-devops-bot
_PKG_VERSION: ${{ needs.validate.outputs.version }}

steps:
- name: Checkout SDK repo
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
Expand Down Expand Up @@ -84,10 +85,66 @@ jobs:
git config --local user.email "${{ env._BOT_EMAIL }}"
git config --local user.name "${{ env._BOT_NAME }}"
- name: Download x86_64-apple-darwin artifact
uses: bitwarden/gh-actions/download-artifacts@main
with:
workflow: build-rust-cross-platform.yml
workflow_conclusion: success
branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }}
artifacts: libbitwarden_c_files-x86_64-apple-darwin
skip_unpack: true

- name: Download aarch64-apple-darwin artifact
uses: bitwarden/gh-actions/download-artifacts@main
with:
workflow: build-rust-cross-platform.yml
workflow_conclusion: success
branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }}
artifacts: libbitwarden_c_files-aarch64-apple-darwin
skip_unpack: true

- name: Download x86_64-unknown-linux-musl artifact
uses: bitwarden/gh-actions/download-artifacts@main
with:
workflow: build-rust-cross-platform.yml
workflow_conclusion: success
branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }}
artifacts: libbitwarden_c_files-x86_64-unknown-linux-musl
skip_unpack: true

- name: Download aarch64-unknown-linux-musl artifact
uses: bitwarden/gh-actions/download-artifacts@main
with:
workflow: build-rust-cross-platform.yml
workflow_conclusion: success
branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }}
artifacts: libbitwarden_c_files-aarch64-unknown-linux-musl
skip_unpack: true

- name: Download x86_64-pc-windows-gnu artifact
uses: bitwarden/gh-actions/download-artifacts@main
with:
workflow: build-rust-cross-platform.yml
workflow_conclusion: success
branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }}
artifacts: libbitwarden_c_files-x86_64-pc-windows-gnu
skip_unpack: true

- name: Update files
run: |
# Copy files to local sm-sdk-go repo path
cp --verbose -rf sdk/languages/go/. sm-sdk-go
# Remove the old cinterface lib files
rm -rf sm-sdk-go/internal/cinterface/lib/*
mkdir -p sm-sdk-go/internal/cinterface/lib/{darwin-{x64,arm64},linux-{x64,arm64},windows-x64}
- name: Extract static libs to their respective directories
run: |
unzip 'libbitwarden_c_files-x86_64-apple-darwin.zip' '*.a' -d sm-sdk-go/internal/cinterface/lib/darwin-x64
unzip 'libbitwarden_c_files-aarch64-apple-darwin.zip' '*.a' -d sm-sdk-go/internal/cinterface/lib/darwin-arm64
unzip 'libbitwarden_c_files-x86_64-unknown-linux-musl.zip' '*.a' -d sm-sdk-go/internal/cinterface/lib/linux-x64
unzip 'libbitwarden_c_files-aarch64-unknown-linux-musl.zip' '*.a' -d sm-sdk-go/internal/cinterface/lib/linux-arm64
unzip 'libbitwarden_c_files-x86_64-pc-windows-gnu.zip' '*.a' -d sm-sdk-go/internal/cinterface/lib/windows-x64
- name: Download artifacts
uses: bitwarden/gh-actions/download-artifacts@main
Expand All @@ -98,12 +155,6 @@ jobs:
branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }}
artifacts: schemas.go

- name: Replace repo name
working-directory: sm-sdk-go
run: |
find . -name '*' -exec \
gsed -i -e 's/github.com\/bitwarden\/sdk\/languages\/go/github.com\/bitwarden\/sm-sdk-go/g' {} \;
- name: Push changes
working-directory: sm-sdk-go
run: |
Expand Down Expand Up @@ -174,27 +225,36 @@ jobs:
artifacts: libbitwarden_c_files-aarch64-apple-darwin
skip_unpack: true

- name: Download x86_64-unknown-linux-gnu artifact
- name: Download x86_64-unknown-linux-musl artifact
uses: bitwarden/gh-actions/download-artifacts@main
with:
workflow: build-rust-cross-platform.yml
workflow_conclusion: success
branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }}
artifacts: libbitwarden_c_files-x86_64-unknown-linux-musl
skip_unpack: true

- name: Download aarch64-unknown-linux-musl artifact
uses: bitwarden/gh-actions/download-artifacts@main
with:
workflow: build-rust-cross-platform.yml
workflow_conclusion: success
branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }}
artifacts: libbitwarden_c_files-x86_64-unknown-linux-gnu
artifacts: libbitwarden_c_files-aarch64-unknown-linux-musl
skip_unpack: true

- name: Download x86_64-pc-windows-msvc artifact
- name: Download x86_64-pc-windows-gnu artifact
uses: bitwarden/gh-actions/download-artifacts@main
with:
workflow: build-rust-cross-platform.yml
workflow_conclusion: success
branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }}
artifacts: libbitwarden_c_files-x86_64-pc-windows-msvc
artifacts: libbitwarden_c_files-x86_64-pc-windows-gnu
skip_unpack: true

- name: Rename build artifacts
run: |
artifacts=("x86_64-apple-darwin" "aarch64-apple-darwin" "x86_64-unknown-linux-gnu" "x86_64-pc-windows-msvc") # aarch64-unknown-linux-gnu)
artifacts=("x86_64-apple-darwin" "aarch64-apple-darwin" "x86_64-unknown-linux-musl" "aarch64-unknown-linux-musl" "x86_64-pc-windows-gnu")
for value in "${artifacts[@]}"
do
unzip libbitwarden_c_files-$value.zip -d libbitwarden_c_files-$value
Expand All @@ -203,7 +263,7 @@ jobs:
cd ..
done
ls ./libbitwarden_c_files-x86_64-apple-darwin-$_PKG_VERSION -lRa
ls ./libbitwarden_c_files-x86_64-apple-darwin-$_PKG_VERSION.zip -lRa
- name: Create release
if: ${{ inputs.release_type != 'Dry Run' }}
Expand All @@ -218,5 +278,6 @@ jobs:
owner: bitwarden
artifacts: "libbitwarden_c_files-x86_64-apple-darwin-${{ env._PKG_VERSION }}.zip,
libbitwarden_c_files-aarch64-apple-darwin-${{ env._PKG_VERSION }}.zip,
libbitwarden_c_files-x86_64-unknown-linux-gnu-${{ env._PKG_VERSION }}.zip,
libbitwarden_c_files-x86_64-pc-windows-msvc-${{ env._PKG_VERSION }}.zip"
libbitwarden_c_files-x86_64-unknown-linux-musl-${{ env._PKG_VERSION }}.zip,
libbitwarden_c_files-aarch64-unknown-linux-musl-${{ env._PKG_VERSION }}.zip,
libbitwarden_c_files-x86_64-pc-windows-gnu-${{ env._PKG_VERSION }}.zip"
83 changes: 53 additions & 30 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/bitwarden-crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ sha1 = ">=0.10.5, <0.11"
sha2 = ">=0.10.6, <0.11"
subtle = ">=2.5.0, <3.0"
thiserror = ">=1.0.40, <2.0"
uniffi = { version = "=0.27.1", optional = true }
uniffi = { version = "=0.27.2", optional = true }
uuid = { version = ">=1.3.3, <2.0", features = ["serde"] }
zeroize = { version = ">=1.7.0, <2.0", features = ["derive", "aarch64"] }

Expand Down
2 changes: 1 addition & 1 deletion crates/bitwarden-generators/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ schemars = { version = ">=0.8.9, <0.9", features = ["uuid1", "chrono"] }
serde = { version = ">=1.0, <2.0", features = ["derive"] }
serde_json = ">=1.0.96, <2.0"
thiserror = ">=1.0.40, <2.0"
uniffi = { version = "=0.27.1", optional = true }
uniffi = { version = "=0.27.2", optional = true }

[dev-dependencies]
rand_chacha = "0.3.1"
Expand Down
Loading

0 comments on commit 3605dbb

Please sign in to comment.