clash-verge-rev/.github/workflows/release.yml

259 lines
8.1 KiB
YAML
Raw Normal View History

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:
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:
fail-fast: false
2022-01-16 14:30:49 +08:00
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: windows-latest
target: i686-pc-windows-msvc
2023-12-10 20:45:27 +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
2022-01-16 14:30:49 +08:00
runs-on: ${{ matrix.os }}
2022-01-16 14:27:41 +08:00
steps:
- name: Checkout Repository
uses: actions/checkout@v4
2022-01-16 14:27:41 +08:00
- name: Install Rust Stable
2024-05-23 11:47:01 +08:00
uses: dtolnay/rust-toolchain@1.77.0
2022-01-16 14:27:41 +08:00
- name: Add Rust Target
2023-12-10 20:45:27 +08:00
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
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
- uses: pnpm/action-setup@v3
2023-11-15 13:52:56 +08:00
name: Install pnpm
with:
2024-04-17 21:48:07 +08:00
version: 9
2023-11-15 13:52:56 +08:00
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
pnpm check ${{ matrix.target }}
2022-01-16 14:27:41 +08:00
- name: Tauri build
uses: tauri-apps/tauri-action@v0
env:
2024-05-29 09:49:11 +08:00
NODE_OPTIONS: "--max_old_space_size=4096"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
2024-06-08 18:06:44 +08:00
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
with:
tagName: v__VERSION__
2024-02-15 18:43:20 +08:00
releaseName: "Clash Verge Rev v__VERSION__"
releaseBody: "More new features are now supported."
2024-06-04 10:47:17 +08:00
tauriScript: pnpm
2023-12-07 13:43:53 +08:00
args: --target ${{ matrix.target }}
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:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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
2023-12-07 15:34:49 +08:00
- 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
env:
2024-05-29 09:49:11 +08:00
NODE_OPTIONS: "--max_old_space_size=4096"
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-05-06 15:30:00 +08:00
uses: softprops/action-gh-release@v2
2023-12-07 15:34:49 +08:00
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 }}
2024-06-04 10:16:25 +08:00
files: |
src-tauri/target/${{ matrix.target }}/release/bundle/deb/*.deb
src-tauri/target/${{ matrix.target }}/release/bundle/rpm/*.rpm
2024-02-21 00:04:11 +08:00
release-for-fixed-webview2:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
arch: x64
- os: windows-latest
target: i686-pc-windows-msvc
arch: x86
- os: windows-latest
target: aarch64-pc-windows-msvc
arch: arm64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Add Rust Target
run: rustup target add ${{ matrix.target }}
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: "20"
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 9
run_install: false
- name: Pnpm install and check
run: |
pnpm i
pnpm check ${{ matrix.target }}
- name: Download WebView2 Runtime
run: |
invoke-webrequest -uri https://github.com/westinyang/WebView2RuntimeArchive/releases/download/109.0.1518.78/Microsoft.WebView2.FixedVersionRuntime.109.0.1518.78.${{ matrix.arch }}.cab -outfile Microsoft.WebView2.FixedVersionRuntime.109.0.1518.78.${{ matrix.arch }}.cab
Expand .\Microsoft.WebView2.FixedVersionRuntime.109.0.1518.78.${{ matrix.arch }}.cab -F:* ./src-tauri
Remove-Item .\src-tauri\tauri.windows.conf.json
Rename-Item .\src-tauri\webview2.${{ matrix.arch }}.json tauri.windows.conf.json
- name: Tauri build
id: build
uses: tauri-apps/tauri-action@v0
env:
2024-05-29 09:49:11 +08:00
NODE_OPTIONS: "--max_old_space_size=4096"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
with:
2024-06-04 10:47:17 +08:00
tauriScript: pnpm
args: --target ${{ matrix.target }}
- name: Rename
run: |
Rename-Item '.\src-tauri\target\${{ matrix.target }}\release\bundle\nsis\Clash Verge_${{steps.build.outputs.appVersion}}_${{ matrix.arch }}-setup.exe' 'Clash Verge_${{steps.build.outputs.appVersion}}_${{ matrix.arch }}_fixed_webview2-setup.exe'
Rename-Item '.\src-tauri\target\${{ matrix.target }}\release\bundle\nsis\Clash Verge_${{steps.build.outputs.appVersion}}_${{ matrix.arch }}-setup.nsis.zip' 'Clash Verge_${{steps.build.outputs.appVersion}}_${{ matrix.arch }}_fixed_webview2-setup.nsis.zip'
Rename-Item '.\src-tauri\target\${{ matrix.target }}\release\bundle\nsis\Clash Verge_${{steps.build.outputs.appVersion}}_${{ matrix.arch }}-setup.nsis.zip.sig' 'Clash Verge_${{steps.build.outputs.appVersion}}_${{ matrix.arch }}_fixed_webview2-setup.nsis.zip.sig'
- name: Upload Release
2024-05-08 11:12:06 +08:00
uses: softprops/action-gh-release@v2
2024-05-06 15:30:00 +08:00
with:
tag_name: v${{steps.build.outputs.appVersion}}
name: "Clash Verge Rev v${{steps.build.outputs.appVersion}}"
body: "More new features are now supported."
token: ${{ secrets.GITHUB_TOKEN }}
2024-05-06 19:13:08 +08:00
files: src-tauri/target/${{ matrix.target }}/release/bundle/nsis/*setup*
2024-05-06 15:30:00 +08:00
2024-05-06 19:13:08 +08:00
- name: Portable Bundle
run: pnpm portable-fixed-webview2 ${{ matrix.target }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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@v4
2024-02-21 00:04:11 +08:00
- name: Install Node
uses: actions/setup-node@v4
2024-02-21 00:04:11 +08:00
with:
node-version: "20"
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 9
2024-02-21 00:04:11 +08:00
run_install: false
- name: Pnpm install
run: pnpm i
- name: Release updater file
run: pnpm updater
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release-update-for-fixed-webview2:
runs-on: ubuntu-latest
needs: [release-for-fixed-webview2]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: "20"
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 9
run_install: false
- name: Pnpm install
run: pnpm i
- name: Release updater file
run: pnpm updater-fixed-webview2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}