2023-11-15 13:52:56 +08:00
name : Release Build
2022-01-16 14:27:41 +08:00
2022-11-03 01:15:50 +08:00
on :
2022-11-24 10:35:22 +08:00
workflow_dispatch :
2022-11-03 01:15:50 +08:00
push :
2023-11-23 11:10:32 +08:00
tags :
- v**
2022-01-16 14:27:41 +08:00
env :
CARGO_INCREMENTAL : 0
RUST_BACKTRACE : short
jobs :
release :
2022-01-16 14:30:49 +08:00
strategy :
2023-11-22 02:56:47 +08:00
fail-fast : false
2022-01-16 14:30:49 +08:00
matrix :
2023-11-30 22:46:09 +08:00
include :
- os : windows-latest
target : x86_64-pc-windows-msvc
# - os: windows-latest
# target: aarch64-pc-windows-msvc
- os : macos-latest
target : aarch64-apple-darwin
- os : macos-latest
target : x86_64-apple-darwin
- os : ubuntu-latest
target : x86_64-unknown-linux-gnu
- os : ubuntu-latest
target : aarch64-unknown-linux-gnu
2023-11-22 02:56:47 +08:00
2022-01-16 14:30:49 +08:00
runs-on : ${{ matrix.os }}
2023-11-22 02:56:47 +08:00
if : startsWith(github.repository, 'wonfen')
2022-01-16 14:27:41 +08:00
steps :
2023-11-30 22:46:09 +08:00
- name : Checkout Repository
2023-11-02 20:14:05 +08:00
uses : actions/checkout@v4
2022-01-16 14:27:41 +08:00
2023-11-30 22:46:09 +08:00
- name : Install Rust Stable
2023-08-12 15:41:26 +08:00
uses : dtolnay/rust-toolchain@stable
2022-01-16 14:27:41 +08:00
2023-11-30 22:46:09 +08:00
- name : Add Rust Target
run : |
rustup target add ${{ matrix.target }}
2022-01-16 14:27:41 +08:00
- name : Rust Cache
2022-11-20 23:17:05 +08:00
uses : Swatinem/rust-cache@v2
2022-06-01 00:47:04 +08:00
with :
2022-11-20 23:17:05 +08:00
workspaces : src-tauri
2022-01-16 14:27:41 +08:00
- name : Install Node
2023-11-02 20:14:05 +08:00
uses : actions/setup-node@v4
2022-01-16 14:27:41 +08:00
with :
2023-11-15 13:52:56 +08:00
node-version : "20"
2022-01-16 14:27:41 +08:00
2023-11-15 13:52:56 +08:00
- uses : pnpm/action-setup@v2
name : Install pnpm
with :
version : 8
run_install : false
- name : Install Dependencies (Ubuntu Only)
2023-11-30 22:46:09 +08:00
if : startsWith(matrix.os, 'ubuntu') && startsWith(matrix.target,'x86_64')
run : |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf openssl
- name : Install Dependencies (Ubuntu Only)
if : startsWith(matrix.os, 'ubuntu') && startsWith(matrix.target,'aarch64')
2022-03-19 10:50:44 +08:00
run : |
2023-11-30 22:46:09 +08:00
sed 's/mirror+file:\/etc\/apt\/apt-mirrors.txt/[arch-=amd64,i386] http:\/\/ports.ubuntu.com\/ubuntu-ports\//g' /etc/apt/sources.list | sudo tee /etc/apt/sources.list.d/ports.list
sudo sed -i 's/mirror+file/[arch=amd64,i386] mirror+file/g' /etc/apt/sources.list
cat /etc/apt/sources.list
cat /etc/apt/sources.list.d/ports.list
sudo dpkg --add-architecture arm64
2023-01-22 13:31:34 +08:00
sudo apt-get update
2023-11-30 22:46:09 +08:00
sudo apt-get install -y libncurses6:arm64 libtinfo6:arm64 linux-libc-dev:arm64 libncursesw6:arm64 libssl3:arm64 libcups2:arm64
sudo apt-get install -y --no-install-recommends g++-aarch64-linux-gnu libc6-dev-arm64-cross libssl-dev:arm64 libwebkit2gtk-4.0-dev:arm64 libgtk-3-dev:arm64 patchelf:arm64 librsvg2-dev:arm64 libayatana-appindicator3-dev:arm64
2022-03-19 10:50:44 +08:00
2023-11-15 13:52:56 +08:00
- name : Pnpm install and check
2022-01-21 03:08:40 +08:00
run : |
2023-11-15 13:52:56 +08:00
pnpm i
2023-11-30 22:46:09 +08:00
pnpm check ${{ matrix.target }}
2022-01-16 14:27:41 +08:00
- name : Tauri build
2023-11-30 22:46:09 +08:00
if : startsWith(matrix.os, 'windows') || startsWith(matrix.os,'macos') || startsWith(matrix.target,'x86_64')
uses : tauri-apps/tauri-action@v0
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY : ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD : ${{ secrets.TAURI_KEY_PASSWORD }}
with :
tagName : v__VERSION__
releaseName : "Clash Verge v__VERSION__"
releaseBody : "More new features are now supported."
releaseDraft : false
prerelease : false
tauriScript : pnpm
args : -f default-meta --target ${{ matrix.target }}
- name : Tauri build (Ubuntu Arm64)
if : startsWith(matrix.os, 'ubuntu') && startsWith(matrix.target,'aarch64')
2022-11-20 23:17:05 +08:00
uses : tauri-apps/tauri-action@v0
2022-01-16 14:27:41 +08:00
env :
2023-11-22 14:52:14 +08:00
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2022-02-16 11:02:00 +08:00
TAURI_PRIVATE_KEY : ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD : ${{ secrets.TAURI_KEY_PASSWORD }}
2023-11-30 22:46:09 +08:00
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER : aarch64-linux-gnu-gcc
CC_aarch64_unknown_linux_gnu : aarch64-linux-gnu-gcc
CXX_aarch64_unknown_linux_gnu : aarch64-linux-gnu-g++
PKG_CONFIG_PATH : /usr/lib/aarch64-linux-gnu/pkgconfig
PKG_CONFIG_ALLOW_CROSS : 1
2022-01-16 14:27:41 +08:00
with :
tagName : v__VERSION__
releaseName : "Clash Verge v__VERSION__"
2022-03-06 18:34:38 +08:00
releaseBody : "More new features are now supported."
2022-01-16 14:27:41 +08:00
releaseDraft : false
2023-11-15 13:52:56 +08:00
prerelease : false
tauriScript : pnpm
2023-11-30 22:46:09 +08:00
args : -f default-meta --target ${{ matrix.target }} -b deb,updater
2022-01-19 00:37:59 +08:00
2022-06-01 00:43:57 +08:00
- name : Portable Bundle
2023-11-23 15:01:30 +08:00
if : matrix.os == 'windows-latest'
2022-03-13 00:59:42 +08:00
run : |
2023-11-15 13:52:56 +08:00
pnpm portable
2022-03-15 00:00:20 +08:00
env :
2023-11-22 14:52:14 +08:00
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2022-08-16 01:53:40 +08:00
TAURI_PRIVATE_KEY : ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD : ${{ secrets.TAURI_KEY_PASSWORD }}
VITE_WIN_PORTABLE : 1
2022-03-13 00:52:31 +08:00
2022-01-19 23:55:05 +08:00
release-update :
2023-11-22 02:56:47 +08:00
needs : [ release]
2023-01-14 12:20:17 +08:00
runs-on : ubuntu-latest
2022-01-19 23:55:05 +08:00
if : |
2023-11-22 02:56:47 +08:00
startsWith(github.repository, 'wonfen') &&
2022-01-19 23:55:05 +08:00
startsWith(github.ref, 'refs/tags/v')
2022-01-19 00:37:59 +08:00
steps :
- name : Checkout repository
2023-11-02 20:14:05 +08:00
uses : actions/checkout@v4
2022-01-19 00:37:59 +08:00
2023-08-12 15:41:26 +08:00
- name : Install Node
2023-11-02 20:14:05 +08:00
uses : actions/setup-node@v4
2022-01-19 00:37:59 +08:00
with :
2023-11-15 13:52:56 +08:00
node-version : "20"
- uses : pnpm/action-setup@v2
name : Install pnpm
with :
version : 8
run_install : false
2022-01-19 00:37:59 +08:00
2023-11-15 13:52:56 +08:00
- name : Pnpm install
run : pnpm i
2022-01-19 00:37:59 +08:00
2022-04-05 23:19:54 +08:00
- name : Release updater file
2023-11-15 13:52:56 +08:00
run : pnpm updater
2022-01-19 00:37:59 +08:00
env :
2023-11-22 14:52:14 +08:00
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}