Skip to content

Commit 13c746a

Browse files
build: update swift package and workflow
1 parent fbd6286 commit 13c746a

File tree

2 files changed

+30
-9
lines changed

2 files changed

+30
-9
lines changed

.github/workflows/build.yml

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,29 @@ jobs:
2626
os: ubuntu-20.04
2727
target: aarch64-unknown-linux-gnu
2828
lib: libanoncreds_uniffi.so
29+
libPath: uniffi/target/aarch64-unknown-linux-gnu/release/libanoncreds_uniffi.so
2930
use_cross: true
3031
- architecture: linux-x86_64
3132
os: ubuntu-20.04
3233
target: x86_64-unknown-linux-gnu
3334
lib: libanoncreds_uniffi.so
35+
libPath: uniffi/target/x86_64-unknown-linux-gnu/release/libanoncreds_uniffi.so
3436
use_cross: true
3537
- architecture: darwin-x86_64
3638
os: macos-latest
3739
target: x86_64-apple-darwin
3840
lib: libanoncreds_uniffi.dylib
41+
libPath: uniffi/target/x86_64-apple-darwin/release/libanoncreds_uniffi.dylib
3942
- architecture: darwin-aarch64
4043
os: macos-latest
4144
target: aarch64-apple-darwin
4245
lib: libanoncreds_uniffi.dylib
46+
libPath: uniffi/target/aarch64-apple-darwin/release/libanoncreds_uniffi.dylib
47+
- architecture: swift-package-universal
48+
os: macos-latest
49+
target: swift-package-universal
50+
lib: libanoncreds.xcframework.zip
51+
libPath: uniffi/output-frameworks/anoncreds-swift/libanoncreds.xcframework.zip
4352

4453
runs-on: ${{ matrix.os }}
4554

@@ -48,7 +57,7 @@ jobs:
4857
uses: actions/checkout@v3
4958

5059
- name: Install Rust toolchain
51-
if: "matrix.target != 'darwin-universal'"
60+
if: "matrix.target != 'swift-package-universal'"
5261
uses: dtolnay/rust-toolchain@stable
5362
with:
5463
toolchain: ${{ env.RUST_VERSION }}
@@ -75,7 +84,7 @@ jobs:
7584
if: "runner.os == 'macOS'"
7685
run: |
7786
cd uniffi
78-
if [ "${{ matrix.architecture }}" == "darwin-universal" ]; then
87+
if [ "${{ matrix.architecture }}" == "swift-package-universal" ]; then
7988
./build-release-apple-universal.sh
8089
else
8190
cargo build --release --target ${{matrix.target}}
@@ -84,22 +93,23 @@ jobs:
8493
- name: Upload library artifacts
8594
uses: actions/upload-artifact@v3
8695
with:
87-
name: library-${{ matrix.architecture }}
88-
path: uniffi/target/${{ matrix.target }}/release/${{ matrix.lib }}
96+
name: ${{ matrix.lib }}
97+
path: ${{ matrix.libPath }}
8998

9099
- name: Create library artifacts directory
91100
if: |
92101
github.event_name == 'release' ||
93102
(github.event_name == 'workflow_dispatch' && github.event.inputs.publish-binaries == 'true')
94103
run: |
95104
mkdir release-artifacts
96-
cp uniffi/target/${{ matrix.target }}/release/${{ matrix.lib }} release-artifacts/
105+
cp ${{ matrix.libPath }} release-artifacts/
97106
98107
- name: Release artifacts
99108
uses: a7ul/[email protected]
100109
if: |
110+
(${{ matrix.architecture }} != 'swift-package-universal' &&
101111
github.event_name == 'release' ||
102-
(github.event_name == 'workflow_dispatch' && github.event.inputs.publish-binaries == 'true')
112+
(github.event_name == 'workflow_dispatch' && github.event.inputs.publish-binaries == 'true'))
103113
with:
104114
command: c
105115
cwd: release-artifacts
@@ -108,9 +118,20 @@ jobs:
108118

109119
- name: Add library artifacts to release
110120
if: |
121+
(${{ matrix.architecture }} != 'swift-package-universal' &&
111122
github.event_name == 'release' ||
112-
(github.event_name == 'workflow_dispatch' && github.event.inputs.publish-binaries == 'true')
123+
(github.event_name == 'workflow_dispatch' && github.event.inputs.publish-binaries == 'true'))
113124
uses: svenstaro/upload-release-action@v2
114125
with:
115126
file: library-${{ matrix.architecture }}.tar.gz
116127
asset_name: "library-${{ matrix.architecture }}-${{ github.sha }}.tar.gz"
128+
129+
- name: Add swift package artifacts to release
130+
if: |
131+
(${{ matrix.architecture }} == 'swift-package-universal' &&
132+
github.event_name == 'release' ||
133+
(github.event_name == 'workflow_dispatch' && github.event.inputs.publish-binaries == 'true'))
134+
uses: svenstaro/upload-release-action@v2
135+
with:
136+
file: ${{ matrix.lib }}
137+
asset_name: "${{ matrix.lib }}"

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ let package = Package(
3232
// RELEASE
3333
.binaryTarget(
3434
name: "libanoncreds",
35-
url: "https://github.com/input-output-hk/anoncreds-rs/releases/download/0.1.0/libanoncreds.xcframework.zip",
36-
checksum: "d4f909adbdd2912ed9fc869aa4b8eba679fb68cf7a0d18887af150f72f08115b"
35+
url: "https://github.com/input-output-hk/anoncreds-rs/releases/download/0.3.0/libanoncreds.xcframework.zip",
36+
checksum: "ca6b65895ceb207ee6d1b1b679fdf0e74185b4b5a44f8a2db9100ccc110fb0a3"
3737
)
3838
]
3939
)

0 commit comments

Comments
 (0)