Skip to content

Upload to build server in publish workflow for nym-vpn-core #24

Upload to build server in publish workflow for nym-vpn-core

Upload to build server in publish workflow for nym-vpn-core #24

name: build-nym-vpn-core-linux
on:
workflow_dispatch:
pull_request:
paths:
- ".github/workflows/build-nym-vpn-core-linux.yml"
workflow_call:
outputs:
RUST_VERSION:
value: ${{ jobs.build-linux.outputs.RUST_VERSION }}
env:
CARGO_TERM_COLOR: always
CARGO_TARGET: release
WG_GO_LIB_PATH: ${{ github.workspace }}/build/lib/x86_64-unknown-linux-gnu
WG_GO_LIB_NAME: wireguard-go_ubuntu-22.04_x86_64
UPLOAD_DIR_LINUX: linux_artifacts
jobs:
build-wireguard-go-linux:
uses: ./.github/workflows/build-wireguard-go-linux.yml
build-linux:
needs: build-wireguard-go-linux
runs-on: ubuntu-22.04
outputs:
UPLOAD_DIR_LINUX: ${{ env.UPLOAD_DIR_LINUX }}
RUST_VERSION: ${{ steps.rust-version.outputs.rustc }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install system dependencies
run: |
sudo apt-get update && sudo apt-get install -y libdbus-1-dev libmnl-dev libnftnl-dev protobuf-compiler
- name: Install rust toolchain
uses: brndnmtthws/rust-action-rustup@v1
with:
toolchain: stable
components: rustfmt, clippy
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
version: "21.12" # 3.21.12: the version on ubuntu 24.04. Don't change this!
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-core
working-directory: nym-vpn-core
env:
RUSTFLAGS: "-L ${{ env.WG_GO_LIB_PATH }}"
run: |
cargo build --${{ env.CARGO_TARGET }}
cargo build -p nym-gateway-probe --${{ env.CARGO_TARGET }}
ls -la nym-vpn-core/target/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_BINARY: nym-vpn-core/target/${{ env.CARGO_TARGET }}/
run: |
mkdir ${{ env.UPLOAD_DIR_LINUX }}
cp -vpr ${{ env.SRC_BINARY }}/nym-gateway-probe ${{ env.UPLOAD_DIR_LINUX }}
cp -vpr ${{ env.SRC_BINARY }}/nym-vpnc ${{ env.UPLOAD_DIR_LINUX }}
cp -vpr ${{ env.SRC_BINARY }}/nym-vpnd ${{ env.UPLOAD_DIR_LINUX }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.UPLOAD_DIR_LINUX }}
path: ${{ env.UPLOAD_DIR_LINUX }}
retention-days: 1