-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (54 loc) · 2.02 KB
/
publish-framework.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Publish Binary Framework
on:
push:
tags: 'build/*.*.*-*'
workflow_dispatch: # trigger manually (for debugging)
jobs:
build_publish:
runs-on: macos-latest
steps:
- name: Apply tag override and parse ref
uses: bisgardo/github-action-parse-ref@v1
id: ref
with:
ref: '${{github.ref}}'
- name: Fail if ref is not a tag
if: "steps.ref.outputs.ref-type != 'tags'"
run: exit 1
- name: Parse tag name
uses: bisgardo/github-action-regex-parse@v1
id: tag
with:
pattern: 'build/(?<version>.*)-.*' # exports 'version'
input: '${{steps.ref.outputs.ref-name}}'
- name: Check out sources
uses: actions/checkout@v4
with:
ref: '${{steps.ref.outputs.ref}}'
submodules: recursive
- name: Setup Rust
run: make setup
- name: Extract version of the crate
uses: bisgardo/github-action-echo@v1
id: crate-version
with:
version: |-
$(cargo metadata --format-version=1 2>/dev/null | jq -r '.packages[] | select(.name == "concordium-wallet-crypto-uniffi") | .version')
- name: Fail if version in tag doesn't match crate version
if: "steps.crate-version.outputs.version != steps.tag.outputs.version"
run: exit 1
- name: Build binary framework
run: make framework # produces './generated/ConcordiumWalletCryptoUniffi.xcframework'
- name: Archive framework and compute checksum
working-directory: ./generated
run: |
ditto -c -k --sequesterRsrc --keepParent ./ConcordiumWalletCryptoUniffi.xcframework ./ConcordiumWalletCryptoUniffi.xcframework.zip
swift package compute-checksum ./ConcordiumWalletCryptoUniffi.xcframework.zip > ./CHECKSUM
- name: Upload framework as GitHub release
uses: softprops/action-gh-release@v2
with:
files: |
./generated/ConcordiumWalletCryptoUniffi.xcframework.zip
./generated/CHECKSUM
name: '${{steps.tag.outputs.version}} (framework)'
generate_release_notes: true