Skip to content

Commit

Permalink
refactor artifact upload to decrease size
Browse files Browse the repository at this point in the history
  • Loading branch information
mimartin12 committed Sep 26, 2023
1 parent 991e04a commit 91c1cb3
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions .github/workflows/build-swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,18 @@ jobs:
run: cargo build --package bitwarden-uniffi --target ${{ matrix.settings.target }} --release
working-directory: languages/swift

- name: Upload artifact
- name: Upload libbitwarden_uniffi.a artifact
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: swift-${{ matrix.settings.target }}
path: ./target/${{ matrix.settings.target }}/release/
name: libbitwarden_uniffi.a-${{ matrix.settings.target }}
path: ./target/${{ matrix.settings.target }}/release/libbitwarden_uniffi.a
if-no-files-found: error

- name: Upload libbitwarden_uniffi.dylib artifact
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: libbitwarden_uniffi.dylib-${{ matrix.settings.target }}
path: ./target/${{ matrix.settings.target }}/release/libbitwarden_uniffi.dylib
if-no-files-found: error

combine:
Expand Down Expand Up @@ -77,14 +84,14 @@ jobs:
run: |
mkdir -p ${{ github.workspace }}/universal-ios-sim/release
lipo -create -output ${{ github.workspace }}/universal-ios-sim/release/libbitwarden_uniffi.a \
./target/swift-aarch64-apple-ios-sim/libbitwarden_uniffi.a \
./target/swift-x86_64-apple-ios/libbitwarden_uniffi.a
./target/libbitwarden_uniffi.a-aarch64-apple-ios-sim/libbitwarden_uniffi.a \
./target/libbitwarden_uniffi.a-x86_64-apple-ios/libbitwarden_uniffi.a
- name: Generate Swift bindings
working-directory: ./languages/swift
run: |
cargo run -p uniffi-bindgen generate \
./target/swift-aarch64-apple-ios-sim/release/libbitwarden_uniffi.dylib \
./target/libbitwarden_uniffi.dylib-aarch64-apple-ios-sim/release/libbitwarden_uniffi.dylib \
--library \
--language swift \
--no-format \
Expand All @@ -102,7 +109,7 @@ jobs:
working-directory: ./languages/swift
run: |
xcodebuild -create-xcframework \
-library ./target/swift-aarch64-apple-ios/release/libbitwarden_uniffi.a \
-library ./target/libbitwarden_uniffi.a-aarch64-apple-ios/release/libbitwarden_uniffi.a \
-headers ./Headers \
-library ${{ github.workspace }}/universal-ios-sim/release/libbitwarden_uniffi.a \
-headers ./Headers \
Expand Down

0 comments on commit 91c1cb3

Please sign in to comment.