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:
|
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-10 20:45:27 +08:00
|
|
|
- os: windows-latest
|
|
|
|
target: aarch64-pc-windows-msvc
|
2023-11-30 22:46:09 +08:00
|
|
|
- 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
|
2023-12-10 20:45:27 +08:00
|
|
|
run: rustup target add ${{ matrix.target }}
|
2023-11-30 22:46:09 +08:00
|
|
|
|
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
|
|
|
|
2024-03-15 19:58:22 +08:00
|
|
|
- uses: pnpm/action-setup@v3
|
2023-11-15 13:52:56 +08:00
|
|
|
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
|
|
|
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__
|
2024-02-15 18:43:20 +08:00
|
|
|
releaseName: "Clash Verge Rev v__VERSION__"
|
2023-11-30 22:46:09 +08:00
|
|
|
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'
|
2023-12-10 20:45:27 +08:00
|
|
|
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-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: aarch64-unknown-linux-gnu
|
2024-03-15 21:14:05 +08:00
|
|
|
- os: ubuntu-latest
|
|
|
|
target: armv7-unknown-linux-gnueabihf
|
2023-12-07 15:34:49 +08:00
|
|
|
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 }}
|
2024-03-15 21:14:05 +08:00
|
|
|
|
2023-12-07 15:34:49 +08:00
|
|
|
- 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
|
2024-03-15 21:14:05 +08:00
|
|
|
|
2023-12-07 15:34:49 +08:00
|
|
|
- name: Upload Release
|
2024-02-15 18:22:15 +08:00
|
|
|
if: startsWith(matrix.target, 'x86_64')
|
2023-12-07 15:34:49 +08:00
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
|
|
|
tag_name: v${{env.VERSION}}
|
2024-02-15 18:43:20 +08:00
|
|
|
name: "Clash Verge Rev v${{env.VERSION}}"
|
2023-12-07 15:34:49 +08:00
|
|
|
body: "More new features are now supported."
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
files: src-tauri/target/${{ matrix.target }}/release/bundle/appimage/*.AppImage*
|
2024-03-15 21:14:05 +08:00
|
|
|
|
2023-12-07 15:34:49 +08:00
|
|
|
- name: Upload Release
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
|
|
|
tag_name: v${{env.VERSION}}
|
2024-02-15 18:43:20 +08:00
|
|
|
name: "Clash Verge Rev v${{env.VERSION}}"
|
2023-12-07 15:34:49 +08:00
|
|
|
body: "More new features are now supported."
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
files: src-tauri/target/${{ matrix.target }}/release/bundle/deb/*.deb
|
2024-02-21 00:04:11 +08:00
|
|
|
|
|
|
|
release-update:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [release, release-for-linux]
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Install Node
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: "20"
|
|
|
|
|
|
|
|
- uses: pnpm/action-setup@v2
|
|
|
|
name: Install pnpm
|
|
|
|
with:
|
|
|
|
version: 8
|
|
|
|
run_install: false
|
|
|
|
|
|
|
|
- name: Pnpm install
|
|
|
|
run: pnpm i
|
|
|
|
|
|
|
|
- name: Release updater file
|
|
|
|
run: pnpm updater
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|