Skip to content

Commit

Permalink
chore: enhance ci
Browse files Browse the repository at this point in the history
  • Loading branch information
zzzgydi committed Jan 16, 2022
1 parent a842586 commit 1a5d9f7
Showing 1 changed file with 92 additions and 0 deletions.
92 changes: 92 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: CI

on: [push]

env:
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: short

strategy:
matrix:
platform: [windows-latest, macos-11]

jobs:
# only cargo test now
test:
runs-on: ${{ matrix.platform }}
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
uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72

- name: Cargo Test
run: |
cargo check
cargo test
working-directory: ./src-tauri

release:
runs-on: ${{ matrix.platform }}
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
uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72

- name: Cargo Test
run: |
cargo check
cargo test
working-directory: ./src-tauri

- name: Install Node
uses: actions/setup-node@v1
with:
node-version: 14

- 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 && yarn run check

- name: Tauri build
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: v__VERSION__
releaseName: "Clash Verge v__VERSION__"
releaseBody: "Clash Verge now supports Windows and macos(intel)."
releaseDraft: false
prerelease: true

0 comments on commit 1a5d9f7

Please sign in to comment.