Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build-nym-vpn-core-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,76 +19,76 @@
uses: ./.github/workflows/build-wireguard-go-ios.yml

build-ios:
needs: build-wireguard-go-ios
runs-on: custom-macos-15
needs: [build-wireguard-go-ios]
runs-on: macos-15
timeout-minutes: 30
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: dtolnay/rust-toolchain@master
with:
toolchain: ${{ vars.REQUIRED_RUSTC_VERSION }}
components: rustfmt, clippy
targets: x86_64-apple-darwin aarch64-apple-ios x86_64-apple-ios aarch64-apple-ios-sim

- name: Install cargo-swift
uses: baptiste0928/cargo-install@v3
with:
crate: 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
uses: baptiste0928/cargo-install@v3
with:
crate: 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.metadata }}

- name: Download wireguard-go artifacts
uses: actions/download-artifact@v5
with:
name: wireguard-go_ios_universal
path: build/lib

- name: Build nym-vpn-lib
working-directory: nym-vpn-core
env:
VPNLIB_SENTRY_DSN: ${{ secrets.VPND_SENTRY_DSN }}
run: |
make -f iOS.mk RELEASE=1

- 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-uniffi/NymVPNLib
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 }}
if-no-files-found: error
retention-days: 1

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
4 changes: 2 additions & 2 deletions .github/workflows/build-nym-vpn-core-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,165 +18,165 @@
uses: ./.github/workflows/build-wireguard-go-mac.yml

build-mac:
needs: build-wireguard-go-mac
needs: [build-wireguard-go-mac]
runs-on: macos-15
timeout-minutes: 45
timeout-minutes: 60
outputs:
UPLOAD_DIR_MAC: ${{ env.UPLOAD_DIR_MAC }}
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ vars.REQUIRED_RUSTC_VERSION }}
components: rustfmt, clippy
targets: x86_64-apple-darwin aarch64-apple-darwin

- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install swift-protobuf
run: |
export HOMEBREW_NO_AUTO_UPDATE=1
export HOMEBREW_NO_ENV_HINTS=1
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1

brew uninstall --ignore-dependencies --force protoc-gen-grpc-swift || true
brew uninstall --ignore-dependencies --force grpc-swift || true
brew uninstall --ignore-dependencies --force swift-protobuf || true

if ! brew tap | grep -q '^nym/local$'; then
brew tap-new nym/local
fi

FORMULA_DIR="$(brew --repo nym/local)/Formula"
mkdir -p "$FORMULA_DIR"

curl -fsSL -o "$FORMULA_DIR/swift-protobuf.rb" https://raw.githubusercontent.com/Homebrew/homebrew-core/7186d42bc60247d6b5e860348db7402f12bca912/Formula/s/swift-protobuf.rb
curl -fsSL -o "$FORMULA_DIR/grpc-swift.rb" https://raw.githubusercontent.com/Homebrew/homebrew-core/e377282a7027ed0ca583939b8fb1d52f8dcdf5a7/Formula/g/grpc-swift.rb

brew install nym/local/swift-protobuf nym/local/grpc-swift

- name: Install cargo-get
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-get

- name: Install cargo-swift
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-swift

- name: Install cargo-edit
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-edit

- name: Update nym-vpn-apple to use latest core
run: |
./scripts/update-nym-vpn-apple-to-latest-core.sh
git status
git diff || echo "No changes detected"
git diff > mac-plist-changes.patch

- name: Upload applied changes
uses: actions/upload-artifact@v4
with:
name: mac-plist-changes.patch
path: mac-plist-changes.patch
if-no-files-found: error
retention-days: 3

- name: Get workspace version
id: workspace-version
uses: nicolaiunrein/cargo-get@master
with:
subcommand: workspace.package.version --entry nym-vpn-core

- 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.metadata }}

- name: Download wireguard-go artifacts
uses: actions/download-artifact@v5
with:
name: wireguard-go_apple_universal
path: build/lib/universal-apple-darwin

- name: Build nym-vpnc (aarch64)
working-directory: nym-vpn-core
env:
SENTRY_DSN: ${{ secrets.VPND_SENTRY_DSN }}
run: |
cargo build -p nym-vpnc --target aarch64-apple-darwin --release

- name: Build nym-vpnd (aarch64)
working-directory: nym-vpn-core
env:
RUSTFLAGS: "-C link-arg=-all_load -C link-arg=-ObjC -C link-arg=-sectcreate -C link-arg=__TEXT -C link-arg=__info_plist -C link-arg=${{ github.workspace }}/nym-vpn-apple/Daemon/Info.plist"
SENTRY_DSN: ${{ secrets.VPND_SENTRY_DSN }}
run: |
cargo build -p nym-vpnd --target aarch64-apple-darwin --release

- name: Build nym-vpnc (x86_64)
working-directory: nym-vpn-core
env:
SENTRY_DSN: ${{ secrets.VPND_SENTRY_DSN }}
run: |
cargo build -p nym-vpnc --target x86_64-apple-darwin --release

- name: Build nym-vpnd (x86_64)
working-directory: nym-vpn-core
env:
RUSTFLAGS: "-C link-arg=-all_load -C link-arg=-ObjC -C link-arg=-sectcreate -C link-arg=__TEXT -C link-arg=__info_plist -C link-arg=${{ github.workspace }}/nym-vpn-apple/Daemon/Info.plist"
SENTRY_DSN: ${{ secrets.VPND_SENTRY_DSN }}
run: |
cargo build -p nym-vpnd --target x86_64-apple-darwin --release

- name: Create universal binaries and prepare for upload
env:
SRC_NATIVE_BINARY: nym-vpn-core/target/aarch64-apple-darwin/release
SRC_X86_64_BINARY: nym-vpn-core/target/x86_64-apple-darwin/release
run: |
mkdir -p ${{ env.UPLOAD_DIR_MAC }}
lipo -create -output ${{ env.UPLOAD_DIR_MAC }}/nym-vpnc ${{ env.SRC_NATIVE_BINARY }}/nym-vpnc ${{ env.SRC_X86_64_BINARY }}/nym-vpnc
lipo -create -output ${{ env.UPLOAD_DIR_MAC }}/nym-vpnd ${{ env.SRC_NATIVE_BINARY }}/nym-vpnd ${{ env.SRC_X86_64_BINARY }}/nym-vpnd

- name: Build nym-vpn-rpc
working-directory: nym-vpn-core
run: |
make -f macOS.mk
cp -v -R crates/nym-vpn-rpc-uniffi/NymVPNRpc ${{ env.UPLOAD_DIR_MAC }}

- name: Compile protobuf for swift (vpn)
working-directory: nym-vpn-core/crates/nym-vpn-proto/proto
run: |
protoc --swift_out=. nym_vpn_service.proto
protoc --grpc-swift_out=. nym_vpn_service.proto

- name: Upload generated protobuf files for swift
uses: actions/upload-artifact@v4
with:
name: swift-proto-files
path: |
nym-vpn-core/crates/nym-vpn-proto/proto/nym_vpn_service.grpc.swift
nym-vpn-core/crates/nym-vpn-proto/proto/nym_vpn_service.pb.swift
if-no-files-found: error
retention-days: 3

- name: Include generated proto files for swift in the bundled upload
run: |
mkdir -p ${{ env.UPLOAD_DIR_MAC }}/proto/nym
cp -v nym-vpn-core/crates/nym-vpn-proto/proto/nym_vpn_service.grpc.swift ${{ env.UPLOAD_DIR_MAC }}/proto/nym
cp -v nym-vpn-core/crates/nym-vpn-proto/proto/nym_vpn_service.pb.swift ${{ env.UPLOAD_DIR_MAC }}/proto/nym

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.UPLOAD_DIR_MAC }}
path: ${{ env.UPLOAD_DIR_MAC }}
if-no-files-found: error
retention-days: 1

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
2 changes: 1 addition & 1 deletion .github/workflows/build-winfw-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,46 +10,46 @@

jobs:
build:
runs-on: "custom-windows-11"
runs-on: custom-windows-11

steps:
- name: Cleanup working directory
shell: bash
run: |
ls -la ./
rm -rf ./* || true
rm -rf ./.??* || true
ls -la ./

- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: true

- name: Install cargo-get
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-get

- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v2

- name: Install GNU make
run: |
winget list GnuWin32.Make || winget install --disable-interactivity --accept-source-agreements --id GnuWin32.Make
echo "${env:ProgramFiles(x86)}\GnuWin32\bin" | Out-File -FilePath "$env:GITHUB_PATH" -Append

- name: Build winfw
shell: pwsh
working-directory: nym-vpn-core
run: make -f Windows.mk winfw CPU_ARCH=AMD64 RELEASE=1

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: winfw
path: |
${{ github.workspace }}/nym-vpn-windows/winfw/bin/x64-Release/winfw.dll
${{ github.workspace }}/nym-vpn-windows/winfw/bin/x64-Release/winfw.lib
if-no-files-found: error
retention-days: 10

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
2 changes: 1 addition & 1 deletion .github/workflows/build-wireguard-go-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,39 @@

jobs:
build:
runs-on: custom-macos-15
runs-on: macos-15
timeout-minutes: 5

steps:
- name: Checkout nym-vpn-client
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ vars.REQUIRED_GOLANG_VERSION }}
cache: false

- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- name: Build wireguard
run: ./wireguard/build-wireguard-go.sh --ios

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: wireguard-go_ios_universal
path: |
build/lib/aarch64-apple-ios
build/lib/aarch64-apple-ios-sim
build/lib/x86_64-apple-ios
if-no-files-found: error
retention-days: 10

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
2 changes: 1 addition & 1 deletion .github/workflows/build-wireguard-go-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,36 @@

jobs:
build:
runs-on: custom-macos-15
runs-on: macos-15
timeout-minutes: 5

steps:
- name: Checkout nym-vpn-client
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ vars.REQUIRED_GOLANG_VERSION }}
cache: false

- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- name: Build wireguard
run: ./wireguard/build-wireguard-go.sh

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: wireguard-go_apple_universal
path: build/lib/universal-apple-darwin
if-no-files-found: error
retention-days: 10

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
2 changes: 1 addition & 1 deletion .github/workflows/build-wireguard-go-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,46 +13,46 @@

jobs:
build:
runs-on: "custom-windows-11"
runs-on: custom-windows-11

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ vars.REQUIRED_GOLANG_VERSION }}
cache: false

- name: Setup msys2
uses: msys2/setup-msys2@v2
id: msys2
with:
update: true
msystem: MINGW64
install: mingw-w64-x86_64-clang

- name: Install GNU make
run: |
winget list GnuWin32.Make || winget install --disable-interactivity --accept-source-agreements --id GnuWin32.Make
echo "${env:ProgramFiles(x86)}\GnuWin32\bin" | Out-File -FilePath "$env:GITHUB_PATH" -Append

- name: Install cargo-get
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-get

- name: Build wireguard
env:
MSYS2_LOCATION: ${{ steps.msys2.outputs.msys2-location }}
working-directory: nym-vpn-core
run: make -f Windows.mk libwg CPU_ARCH=AMD64

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: wireguard-go_x86_64-pc-windows-msvc
path: build/lib/x86_64-pc-windows-msvc
if-no-files-found: error
retention-days: 1

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
2 changes: 1 addition & 1 deletion .github/workflows/ci-nym-vpn-app-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [arc-linux-latest, custom-macos-15, macos-15, custom-windows-11]
os: [arc-linux-latest, macos-15, custom-windows-11]
runs-on: ${{ matrix.os }}
timeout-minutes: 30

Expand Down
19 changes: 2 additions & 17 deletions .github/workflows/ci-nym-vpn-core-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,89 +18,74 @@
uses: ./.github/workflows/build-wireguard-go-ios.yml

build:
runs-on: ${{ matrix.runner }}
needs: build-wireguard-go-ios
runs-on: macos-15
needs: [build-wireguard-go-ios]
timeout-minutes: 30

strategy:
fail-fast: false
matrix:
runner:
- custom-macos-15
- macos-15

steps:
- name: Cleanup working directory
if: matrix.runner == 'custom-macos-15'
shell: bash
run: |
ls -la ./
rm -rf ./* || true
rm -rf ./.??* || true
ls -la ./

- name: Checkout repo
uses: actions/checkout@v4

- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ vars.REQUIRED_RUSTC_VERSION }}
components: rustfmt, clippy
targets: aarch64-apple-ios

- 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: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-

- name: Cache Cargo build
uses: actions/cache@v4
with:
path: nym-vpn-core/target/
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('nym-vpn-core/**/*.rs') }}
restore-keys: |
${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}-
${{ runner.os }}-cargo-build-

- name: Download artifacts
uses: actions/download-artifact@v5
with:
name: wireguard-go_ios_universal
path: build/lib

- name: rustfmt check
working-directory: nym-vpn-core
run: |
cargo fmt --check --all

- name: Clippy
working-directory: nym-vpn-core
run: |
cargo clippy --target aarch64-apple-ios -p nym-vpn-lib-uniffi --locked -- -Dwarnings

- name: Build
working-directory: nym-vpn-core
run: |
cargo build --verbose --target aarch64-apple-ios -p nym-vpn-lib-uniffi --locked

- name: Generate uniffi
working-directory: nym-vpn-core
run: |
cargo run -p uniffi-bindgen generate \
--library target/aarch64-apple-ios/debug/libnym_vpn_lib_uniffi.a \
--config crates/nym-vpn-lib-uniffi/uniffi.toml \
--language swift --out-dir build -n

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
19 changes: 2 additions & 17 deletions .github/workflows/ci-nym-vpn-core-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,91 +16,76 @@
uses: ./.github/workflows/build-wireguard-go-mac.yml

build:
runs-on: ${{ matrix.runner }}
needs: build-wireguard-go-mac
runs-on: macos-15
needs: [build-wireguard-go-mac]
timeout-minutes: 30

strategy:
fail-fast: false
matrix:
runner:
- custom-macos-15
- macos-15

steps:
- name: Cleanup working directory
if: matrix.runner == 'custom-macos-15'
shell: bash
run: |
ls -la ./
rm -rf ./* || true
rm -rf ./.??* || true
ls -la ./

- name: Checkout repo
uses: actions/checkout@v4

- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ vars.REQUIRED_RUSTC_VERSION }}
components: rustfmt, clippy

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ vars.REQUIRED_GOLANG_VERSION }}
cache: false

- 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: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-

- name: Cache Cargo build
uses: actions/cache@v4
with:
path: nym-vpn-core/target/
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('nym-vpn-core/**/*.rs') }}
restore-keys: |
${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}-
${{ runner.os }}-cargo-build-

- name: Download artifacts
uses: actions/download-artifact@v5
with:
name: wireguard-go_apple_universal
path: build/lib/universal-apple-darwin

- name: rustfmt check
working-directory: nym-vpn-core
run: |
cargo fmt --check --all

- name: Clippy
working-directory: nym-vpn-core
run: |
cargo clippy --workspace --locked -- -Dwarnings

- name: Build
working-directory: nym-vpn-core
run: |
cargo build --verbose --workspace --locked

- name: Run tests
working-directory: nym-vpn-core
run: |
cargo test --verbose --workspace --locked

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
2 changes: 1 addition & 1 deletion .github/workflows/ci-nym-vpn-core-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

build:
runs-on: custom-windows-11
needs: build-wireguard-go-windows
needs: [build-wireguard-go-windows]

steps:
- name: "Cleanup working directory"
Expand Down
Loading