Upload to build server in publish workflow for nym-vpn-core #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |