1 #169
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release CI | |
on: | |
workflow_dispatch: | |
# schedule: | |
# - cron: '0 17 * * *' | |
push: | |
branches: | |
- main | |
tags: | |
- v** | |
env: | |
CARGO_INCREMENTAL: 0 | |
RUST_BACKTRACE: short | |
jobs: | |
release: | |
strategy: | |
matrix: | |
os: [windows-latest, ubuntu-latest, macos-12] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: install Rust stable | |
uses: dtolnay/rust-toolchain@stable | |
- name: Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: src-tauri | |
- name: Install Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "16" | |
cache: "yarn" | |
- name: Install Dependencies (ubuntu only) | |
if: startsWith(matrix.os, 'ubuntu-') | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf openssl | |
- name: Yarn install and check | |
run: | | |
yarn install --network-timeout 1000000 --frozen-lockfile | |
yarn run check | |
- name: BundleLinux | |
if: startsWith(matrix.os, 'ubuntu-') | |
# rebuild with env settings | |
run: | | |
yarn build | |
cp src-tauri/target/release/bundle/appimage/clash-verge_*_amd64.AppImage "output/ClashVerge_amd64.AppImage" | |
cp src-tauri/target/release/bundle/deb/clash-verge*amd64.deb "output/ClashVerge_amd64.deb" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} | |
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} | |
VITE_WIN_PORTABLE: 1 | |
- name: BuildWindows | |
if: startsWith(matrix.os, 'windows-') | |
# rebuild with env settings | |
run: | | |
yarn build | |
yarn run portable | |
cp src-tauri/target/release/bundle/msi/ClashVerge_*_x64_en-US.msi output/ClashVerge_amd64-en-US.msi | |
cp src-tauri/target/release/bundle/msi/ClashVerge_*_x64_zh-CN.msi output/ClashVerge_amd64-zh-CN.msi | |
cp src-tauri/target/release/bundle/msi/ClashVerge_*_x64_ru-RU.msi output/ClashVerge_amd64-ru-RU.msi | |
cp src-tauri/target/release/bundle/nsis/ClashVerge_*_x64-setup.exe output/ClashVerge_amd64-setup.exe | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} | |
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} | |
VITE_WIN_PORTABLE: 1 | |
- name: BuildMac | |
if: startsWith(matrix.os, 'macos-') | |
# rebuild with env settings | |
run: | | |
brew install jq | |
sudo chown root:admin src-tauri/sidecar/* | |
sudo chmod +sx src-tauri/sidecar/* | |
yarn build | |
rustup target add aarch64-apple-darwin | |
yarn build-m1 | |
version=$(jq -rM .package.version src-tauri/tauri.conf.json) | |
tar cvzf output/ClashVerge_amd64.app.tar.gz -C src-tauri/target/release/bundle/macos/ ClashVerge.app | |
tar cvzf output/ClashVerge_amd64.dmg.tar.gz -C src-tauri/target/release/bundle/dmg ClashVerge\_$version\_x64.dmg | |
tar cvzf output/ClashVerge_aarch64.app.tar.gz -C src-tauri/target/aarch64-apple-darwin/release/bundle/macos ClashVerge.app | |
tar cvzf output/ClashVerge_aarch64.dmg.tar.gz -C src-tauri/target/aarch64-apple-darwin/release/bundle/dmg ClashVerge\_$version\_aarch64.dmg | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} | |
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} | |
VITE_WIN_PORTABLE: 1 | |
- name: Upload release | |
uses: softprops/action-gh-release@v2 | |
if: ${{ success() }} | |
with: | |
tag_name: latest | |
files: | | |
output/* | |
prerelease: false | |
generate_release_notes: false | |
body: release |