-
Notifications
You must be signed in to change notification settings - Fork 12
153 lines (137 loc) · 5.28 KB
/
build-nym-vpn-app-linux.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
name: build-nym-vpn-app-linux
on:
workflow_dispatch:
inputs:
dev_mode:
description: "dev build"
required: true
type: boolean
default: false
workflow_call:
inputs:
# set to true when it is a 'dev' build
dev_mode:
required: true
type: boolean
default: false
secrets:
TAURI_PRIVATE_KEY:
required: true
TAURI_KEY_PASSWORD:
required: true
DESKTOP_JS_SENTRY_DSN:
required: true
outputs:
UPLOAD_DIR_LINUX:
value: ${{ jobs.build-linux.outputs.UPLOAD_DIR_LINUX }}
PKG_VERSION:
value: ${{ jobs.build-linux.outputs.PKG_VERSION }}
RUST_VERSION:
value: ${{ jobs.build-linux.outputs.RUST_VERSION }}
env:
CARGO_TERM_COLOR: always
CARGO_TARGET: release
UPDATER_BUNDLE_NAME: updater_linux_x86_64.AppImage.tar.gz
UPLOAD_DIR_LINUX: linux_artifacts
jobs:
build-linux:
runs-on: ubuntu-22.04
outputs:
UPLOAD_DIR_LINUX: ${{ env.UPLOAD_DIR_LINUX }}
PKG_VERSION: ${{ steps.package-version.outputs.metadata }}
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 \
libwebkit2gtk-4.1-dev build-essential curl wget libssl-dev jq \
libgtk-3-dev squashfs-tools libayatana-appindicator3-dev make libfuse2 unzip librsvg2-dev file \
libsoup-3.0-dev libjavascriptcoregtk-4.1-dev
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Install cargo-license
run: cargo install --locked cargo-license
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
version: "21.12" # version on ubuntu 24.04
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Get package version
id: package-version
uses: nicolaiunrein/cargo-get@master
with:
subcommand: package.version --entry nym-vpn-app/src-tauri
- name: Get rust version used for build
id: rust-version
run: |
echo "rustc=$(rustc -V)" >> $GITHUB_OUTPUT
- name: Install JS dependencies
working-directory: nym-vpn-app
shell: bash
run: npm ci
- name: Generate licenses file (Js)
working-directory: nym-vpn-app
shell: bash
run: |
rm public/licenses-js.json || true
npm run gen:licenses:js
- name: Generate licenses file (Rust)
working-directory: nym-vpn-app
shell: bash
run: |
rm public/licenses-rust.json || true
npm run gen:licenses:rust
- name: Build tauri app
working-directory: nym-vpn-app/src-tauri
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
APP_SENTRY_DSN: ${{ secrets.DESKTOP_JS_SENTRY_DSN }}
# RUSTFLAGS: "-L ${{ env.WG_GO_LIB_PATH }}"
DEV_MODE: ${{ inputs.dev_mode == true }}
run: |
if [ "${{ env.CARGO_TARGET }}" = "release" ]; then
npm run tauri build
else
npm run tauri build -- --debug
fi
ls -la target/release/ || true
ls -la target/release/bundle || true
ls -la target/release/bundle/* || true
- name: Rename deb file from NymVPN to nym-vpn-app
env:
SRC_DEB: nym-vpn-app/src-tauri/target/release/bundle/deb/NymVPN_${{ steps.package-version.outputs.metadata }}_amd64.deb
run: |
./scripts/rename-nym-vpn-app-deb.sh $SRC_DEB
- name: Move things around to prepare for upload
env:
SRC_APPIMAGE: nym-vpn-app/src-tauri/target/release/bundle/appimage/NymVPN_${{ steps.package-version.outputs.metadata }}_amd64.AppImage
DST_APPIMAGE: NymVPN_${{ steps.package-version.outputs.metadata }}_x64.AppImage
SRC_DEB: nym-vpn-app_${{ steps.package-version.outputs.metadata }}_amd64.deb
SRC_BIN: nym-vpn-app/src-tauri/target/release/nym-vpn-app
DST_BIN: nym-vpn_${{ steps.package-version.outputs.metadata }}_linux_x64
run: |
mkdir ${{ env.UPLOAD_DIR_LINUX }}
echo "Copy AppImage"
cp -vpr ${{ env.SRC_APPIMAGE }} ${{ env.UPLOAD_DIR_LINUX }}/${{ env.DST_APPIMAGE }}
#echo "Copy updater bundle and signature"
#cp -vpr ${{ env.SRC_APPIMAGE }}.tar.gz ${{ env.UPLOAD_DIR_LINUX }}/${{ env.UPDATER_BUNDLE_NAME }}
#cp -vpr ${{ env.SRC_APPIMAGE }}.tar.gz.sig ${{ env.UPLOAD_DIR_LINUX }}/${{ env.UPDATER_BUNDLE_NAME }}.sig
echo "Copy debian pkg"
cp -vpr ${{ env.SRC_DEB }} ${{ env.UPLOAD_DIR_LINUX }}
echo "Copy plain binary"
cp -vpr ${{ env.SRC_BIN }} ${{ env.UPLOAD_DIR_LINUX }}/${{ env.DST_BIN }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.UPLOAD_DIR_LINUX }}
path: ${{ env.UPLOAD_DIR_LINUX }}
retention-days: 1