Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SM-1236] - Add new targets for Go wrapper #772

Merged
merged 6 commits into from
May 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 24 additions & 2 deletions .github/workflows/build-rust-cross-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,14 @@ jobs:
target: aarch64-apple-darwin
- os: windows-2022
target: x86_64-pc-windows-msvc
- os: windows-2022
target: x86_64-pc-windows-gnu
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
- os: ubuntu-22.04
target: x86_64-unknown-linux-musl
- os: ubuntu-22.04
target: aarch64-unknown-linux-musl

steps:
- name: Checkout
Expand All @@ -39,13 +45,29 @@ jobs:
- name: Cache cargo registry
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3

- uses: goto-bus-stop/setup-zig@7ab2955eb728f5440978d5824358023be3a2802d # v2.2.0
if: ${{ contains(matrix.settings.target, 'musl') }}
with:
version: 0.12.0

- name: Install Zigbuild
if: ${{ contains(matrix.settings.target, 'musl') }}
run: cargo install cargo-zigbuild --locked --git https://github.com/rust-cross/cargo-zigbuild --rev 6f7e1336c9cd13cf1b3704f93c40fcf84caaed6b # 0.18.4

- name: Add build architecture
run: rustup target add ${{ matrix.settings.target }}

- name: Build Rust
- name: Build Rust for - ${{ matrix.settings.target }}
if: ${{ contains(matrix.settings.target, 'musl') }}
env:
RUSTFLAGS: "-D warnings"
run: cargo zigbuild -p bitwarden-c --target ${{ matrix.settings.target }} --release

- name: Build Rust for - ${{ matrix.settings.target }}
if: ${{ !contains(matrix.settings.target, 'musl') }}
env:
RUSTFLAGS: "-D warnings"
run: cargo build --target ${{ matrix.settings.target }} --release
run: cargo build -p bitwarden-c --target ${{ matrix.settings.target }} --release
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I adjusted this workflow so that it only builds the artifacts for the bitwarden-c crate. Let me know if the other builds are actually necessary in this workflow. As far as I can tell, they aren't getting used anywhere else, but I could have missed something

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we are only uploading artifacts for files matching *bitwarden_c*, so this seems fine to me.


- name: Upload Artifact
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
Expand Down