Build #14
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 | |
on: | |
workflow_dispatch: | |
inputs: | |
platform: | |
description: "Target platform" | |
required: true | |
default: "linux" | |
type: choice | |
options: | |
- linux | |
- windows | |
- macos | |
jobs: | |
build_linux: | |
name: Build linux | |
runs-on: ubuntu-latest | |
if: ${{ inputs.platform == 'linux' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
- name: Install Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install dependencies | |
run: sudo apt-get update && sudo apt-get -y install libwebkit2gtk-4.0-dev build-essential curl wget file libssl-dev libgtk-3-dev librsvg2-dev | |
- name: Install | |
working-directory: app | |
run: npm i | |
- name: Build app | |
working-directory: app/src-tauri | |
run: | | |
npm run build | |
cargo build --release --locked | |
- name: Build runner | |
working-directory: runner | |
run: cargo build --locked | |
- name: Prepare artifacts | |
run: | | |
mkdir lib | |
mv app/src-tauri/target/release/libvpnym.so lib/ | |
mv runner/target/debug/vpnym_d . | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: vpnym_linux | |
path: | | |
lib/ | |
vpnym_d | |
build_windows: | |
name: Build windows | |
runs-on: windows-latest | |
if: ${{ inputs.platform == 'windows' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
- name: Install Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install | |
working-directory: app | |
run: npm i | |
- name: Build app | |
working-directory: app/src-tauri | |
run: | | |
npm run build | |
cargo build --release --locked | |
- name: Build runner | |
working-directory: runner | |
run: cargo build --locked | |
- name: Prepare artifacts | |
run: | | |
ls | |
ls app/src-tauri | |
ls app/src-tauri/target | |
ls app/src-tauri/target/release | |
mkdir lib | |
ls | |
mv app/src-tauri/target/release/vpnym.dll lib/ | |
mv app/src-tauri/target/release/WebView2Loader.dll lib/ | |
mv runner/target/debug/vpnym_d.exe . | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: vpnym_windows | |
path: | | |
lib/ | |
vpnym_d.exe | |
build_darwin: | |
name: Build macos | |
runs-on: macos-latest | |
if: ${{ inputs.platform == 'macos' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
- name: Install Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install | |
working-directory: app | |
run: npm i | |
- name: Build app | |
working-directory: app/src-tauri | |
run: | | |
npm run build | |
cargo build --release --locked | |
- name: Build runner | |
working-directory: runner | |
run: cargo build --locked | |
- name: Prepare artifacts | |
run: | | |
mkdir lib | |
mv app/src-tauri/target/release/libvpnym.dylib lib/ | |
mv runner/target/debug/vpnym_d . | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: vpnym_darwin | |
path: | | |
lib/ | |
vpnym_d |