-
Notifications
You must be signed in to change notification settings - Fork 12
93 lines (79 loc) · 2.79 KB
/
build-nym-vpn-core-ios.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: build-nym-vpn-core-ios
on:
workflow_dispatch:
pull_request:
paths:
- ".github/workflows/build-nym-vpn-core-ios.yml"
workflow_call:
outputs:
RUST_VERSION:
value: ${{ jobs.build-ios.outputs.RUST_VERSION }}
env:
IPHONEOS_DEPLOYMENT_TARGET: 16.0
CARGO_TERM_COLOR: always
CARGO_TARGET: release
WG_GO_LIB_PATH: ${{ github.workspace }}/build/lib
WG_GO_LIB_NAME: wireguard-go_ios_universal
UPLOAD_DIR_IOS: ios_artifacts
jobs:
build-wireguard-go-ios:
uses: ./.github/workflows/build-wireguard-go-ios.yml
build-ios:
needs: build-wireguard-go-ios
runs-on: macos-14
outputs:
UPLOAD_DIR_IOS: ${{ env.UPLOAD_DIR_IOS }}
RUST_VERSION: ${{ steps.rust-version.outputs.rustc }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install rust toolchain
uses: brndnmtthws/rust-action-rustup@v1
with:
toolchain: stable
components: rustfmt, clippy
targets: x86_64-apple-darwin aarch64-apple-ios x86_64-apple-ios aarch64-apple-ios-sim
- name: Setup cargo swift
run: |
cargo install cargo-swift
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Get workspace version
id: workspace-version
uses: nicolaiunrein/cargo-get@master
with:
subcommand: workspace.package.version --entry nym-vpn-core
- name: Install cargo-edit
run: cargo install --locked cargo-edit
- name: Append timestamp if it's a dev version
run: ./scripts/append-timestamp-to-version.sh nym-vpn-core/Cargo.toml ${{ steps.workspace-version.outputs.output }}
- name: Download wireguard-go artifacts
uses: actions/download-artifact@v4
with:
name: ${{ env.WG_GO_LIB_NAME }}
path: ${{ env.WG_GO_LIB_PATH }}
- name: Build nym-vpn-lib
working-directory: nym-vpn-core/crates/nym-vpn-lib
env:
RUSTFLAGS: "-L ${{ env.WG_GO_LIB_PATH }}"
run: |
cargo swift package -p ios -n NymVpnLib --${{ env.CARGO_TARGET }}
ls -la ../target/universal-ios/release/ || true
- name: Get rust version used for build
id: rust-version
run: |
echo "rustc=$(rustc -V)" >> $GITHUB_OUTPUT
- name: Move things around to prepare for upload
env:
SRC_DIR: nym-vpn-core/crates/nym-vpn-lib/NymVpnLib/RustFramework.xcframework
run: |
mkdir ${{ env.UPLOAD_DIR_IOS }}
cp -vpr ${{ env.SRC_DIR }} ${{ env.UPLOAD_DIR_IOS }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.UPLOAD_DIR_IOS }}
path: ${{ env.UPLOAD_DIR_IOS }}
retention-days: 1