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**
|
2023-12-03 14:26:03 +08:00
|
|
|
permissions: write-all
|
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
|
2023-12-01 11:03:18 +08:00
|
|
|
- os: windows-latest
|
|
|
|
target: i686-pc-windows-msvc
|
2023-11-30 22:46:09 +08:00
|
|
|
# - os: windows-latest
|
|
|
|
# target: aarch64-pc-windows-msvc
|
|
|
|
- os: macos-latest
|
|
|
|
target: aarch64-apple-darwin
|
|
|
|
- os: macos-latest
|
|
|
|
target: x86_64-apple-darwin
|
2023-11-22 02:56:47 +08:00
|
|
|
|
2022-01-16 14:30:49 +08:00
|
|
|
runs-on: ${{ matrix.os }}
|
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: 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
|
2023-12-07 13:43:53 +08:00
|
|
|
args: --target ${{ matrix.target }}
|
2023-11-30 22:46:09 +08:00
|
|
|
|
2023-12-07 15:34:49 +08:00
|
|
|
- name: Portable Bundle
|
|
|
|
if: matrix.os == 'windows-latest'
|
|
|
|
run: |
|
|
|
|
pnpm portable ${{ matrix.target }}
|
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-12-07 15:34:49 +08:00
|
|
|
VITE_WIN_PORTABLE: 1
|
2023-12-01 11:03:18 +08:00
|
|
|
|
2023-12-07 15:34:49 +08:00
|
|
|
release-for-linux:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- os: ubuntu-latest
|
|
|
|
target: x86_64-unknown-linux-gnu
|
|
|
|
- os: ubuntu-latest
|
|
|
|
target: i686-unknown-linux-gnu
|
|
|
|
- os: ubuntu-latest
|
|
|
|
target: aarch64-unknown-linux-gnu
|
|
|
|
# - os: ubuntu-latest
|
|
|
|
# target: armv7-unknown-linux-gnueabihf
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout Repository
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Build for Linux
|
|
|
|
uses: ./.github/build-for-linux
|
2023-12-01 11:03:18 +08:00
|
|
|
env:
|
|
|
|
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
|
|
|
|
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
|
|
|
|
with:
|
2023-12-07 15:34:49 +08:00
|
|
|
target: ${{ matrix.target }}
|
|
|
|
- name: Get Version
|
2022-03-13 00:59:42 +08:00
|
|
|
run: |
|
2023-12-07 15:34:49 +08:00
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install jq
|
2023-12-07 15:57:53 +08:00
|
|
|
echo "VERSION=$(cat package.json | jq '.version' | tr -d '"')" >> $GITHUB_ENV
|
2023-12-07 15:34:49 +08:00
|
|
|
- name: Upload Release
|
2023-12-07 16:38:39 +08:00
|
|
|
if: startsWith(matrix.target, 'x86_64') || startsWith(matrix.target, 'i686')
|
2023-12-07 15:34:49 +08:00
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
|
|
|
tag_name: v${{env.VERSION}}
|
|
|
|
name: "Clash Verge v${{env.VERSION}}"
|
|
|
|
body: "More new features are now supported."
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
files: src-tauri/target/${{ matrix.target }}/release/bundle/appimage/*.AppImage*
|
|
|
|
- name: Upload Release
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
|
|
|
tag_name: v${{env.VERSION}}
|
|
|
|
name: "Clash Verge v${{env.VERSION}}"
|
|
|
|
body: "More new features are now supported."
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
files: src-tauri/target/${{ matrix.target }}/release/bundle/deb/*.deb
|
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
|
2023-12-01 11:11:20 +08:00
|
|
|
if: 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 }}
|