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

110 lines
2.9 KiB
YAML
Raw Normal View History

2022-05-17 02:17:02 +08:00
name: Alpha CI
2022-05-17 02:11:29 +08:00
2022-11-12 17:07:47 +08:00
on:
workflow_dispatch:
2022-11-21 23:19:25 +08:00
inputs:
debug:
type: boolean
default: false
2022-05-17 02:11:29 +08:00
env:
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: short
jobs:
release:
strategy:
2022-11-12 16:47:27 +08:00
fail-fast: false
2022-05-17 02:11:29 +08:00
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
if: startsWith(github.repository, 'zzzgydi')
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-12 16:47:27 +08:00
uses: Swatinem/rust-cache@v2
2022-05-17 12:34:30 +08:00
with:
2022-11-12 16:47:27 +08:00
workspaces: src-tauri
2022-05-17 02:11:29 +08:00
- name: Install Node
uses: actions/setup-node@v1
with:
2022-11-12 16:47:27 +08:00
node-version: 16
2022-05-17 02:11:29 +08:00
2023-03-16 13:18:05 +08:00
- name: Delete current release assets
if: matrix.os == 'ubuntu-latest'
uses: mknejp/delete-release-assets@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: alpha
fail-if-no-assets: false
fail-if-no-release: false
assets: |
*.zip
*.gz
*.AppImage
*.deb
*.dmg
*.msi
*.sig
2022-05-17 02:11:29 +08:00
- name: Install Dependencies (ubuntu only)
2023-01-18 23:39:27 +08:00
if: startsWith(matrix.os, 'ubuntu-')
2022-05-17 02:11:29 +08:00
run: |
2023-01-19 18:02:08 +08:00
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf openssl
2022-05-17 02:11:29 +08: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
run: |
yarn install --network-timeout 1000000
2022-06-01 00:43:57 +08:00
yarn run check
2022-05-17 02:11:29 +08:00
2022-06-01 00:43:57 +08:00
- name: Tauri build
2022-11-12 16:54:57 +08:00
uses: tauri-apps/tauri-action@v0
2022-05-17 02:11:29 +08:00
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
with:
tagName: alpha
releaseName: "Clash Verge Alpha"
2022-11-12 16:47:27 +08:00
releaseBody: "Alpha Version (include debug)"
releaseDraft: false
2022-11-21 23:19:25 +08:00
includeDebug: ${{ github.event.inputs.debug }}
2022-05-17 02:11:29 +08:00
prerelease: true
2022-11-24 11:14:03 +08:00
args: -f default-meta
2022-05-17 02:46:15 +08:00
2022-11-22 00:16:30 +08:00
- name: Portable Bundle
if: matrix.os == 'windows-latest'
run: |
2022-11-24 11:14:03 +08:00
yarn build -f default-meta
2022-11-22 00:16:30 +08:00
yarn run portable
env:
TAG_NAME: alpha
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2022-11-24 11:14:03 +08:00
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
VITE_WIN_PORTABLE: 1