clash-verge/.github/workflows/ci.yml

123 lines
3.4 KiB
YAML
Raw Normal View History

2022-02-21 20:56:06 +03:00
name: Release CI
2022-01-16 09:27:41 +03:00
2022-11-02 20:15:50 +03:00
on:
push:
tags:
- v**
2022-01-16 09:27:41 +03:00
env:
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: short
jobs:
release:
2022-01-16 09:30:49 +03:00
strategy:
matrix:
2022-09-24 11:08:39 +03:00
os: [windows-latest, ubuntu-latest, macos-latest]
2022-01-16 09:30:49 +03:00
runs-on: ${{ matrix.os }}
2022-01-16 09:27:41 +03:00
if: |
startsWith(github.repository, 'zzzgydi') &&
startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Rust Cache
2022-11-20 18:17:05 +03:00
uses: Swatinem/rust-cache@v2
2022-05-31 19:47:04 +03:00
with:
2022-11-20 18:17:05 +03:00
workspaces: src-tauri
2022-01-16 09:27:41 +03:00
- name: Install Node
uses: actions/setup-node@v1
with:
2022-11-20 18:14:43 +03:00
node-version: 16
2022-01-16 09:27:41 +03:00
2022-03-19 05:50:44 +03:00
- name: Install Dependencies (ubuntu only)
2022-09-01 20:27:06 +03:00
if: startsWith(matrix.os, 'ubuntu-')
2022-03-19 05:50:44 +03:00
run: |
sudo apt-get update
2022-05-11 07:39:41 +03:00
sudo apt-get install -y libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev libappindicator3-dev librsvg2-dev libayatana-appindicator3-dev
2022-03-19 05:50:44 +03:00
2022-01-16 09:27:41 +03:00
- name: Get yarn cache dir path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Yarn Cache
uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Yarn install and check
2022-01-20 22:08:40 +03:00
run: |
yarn install --network-timeout 1000000
yarn run check
2022-01-16 09:27:41 +03:00
- name: Tauri build
2022-11-20 18:17:05 +03:00
uses: tauri-apps/tauri-action@v0
2022-01-16 11:03:53 +03:00
# enable cache even though failed
2022-05-11 07:39:41 +03:00
# continue-on-error: true
2022-01-16 09:27:41 +03:00
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2022-02-16 06:02:00 +03:00
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
2022-01-16 09:27:41 +03:00
with:
tagName: v__VERSION__
releaseName: "Clash Verge v__VERSION__"
2022-03-06 13:34:38 +03:00
releaseBody: "More new features are now supported."
2022-01-16 09:27:41 +03:00
releaseDraft: false
prerelease: true
2022-01-18 19:37:59 +03:00
2022-05-31 19:43:57 +03:00
- name: Portable Bundle
2022-03-19 05:50:44 +03:00
if: matrix.os == 'windows-latest'
# rebuild with env settings
2022-03-12 19:59:42 +03:00
run: |
yarn build
2022-04-12 20:17:40 +03:00
yarn run portable
2022-03-14 19:00:20 +03:00
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
VITE_WIN_PORTABLE: 1
2022-03-12 19:52:31 +03:00
2022-01-19 18:55:05 +03:00
release-update:
needs: release
2022-03-19 05:50:44 +03:00
runs-on: macos-latest
2022-01-19 18:55:05 +03:00
if: |
startsWith(github.repository, 'zzzgydi') &&
startsWith(github.ref, 'refs/tags/v')
2022-01-18 19:37:59 +03:00
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get yarn cache dir path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Yarn Cache
uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Yarn install
2022-03-19 05:50:44 +03:00
run: yarn install
2022-01-18 19:37:59 +03:00
- name: Release updater file
run: yarn run updater
2022-01-18 19:37:59 +03:00
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}