-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (77 loc) · 2.7 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Release
on: ["push", "pull_request"]
env:
CARGO_TERM_COLOR: always
jobs:
release:
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-latest, windows-latest]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Cache pnpm
uses: actions/cache@v2
env:
cache-name: cache-pnpm-modules
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-
- name: Cache tauri
uses: actions/cache@v2
env:
cache-name: cache-cargo-tauri
with:
path: ~/.cargo/bin/
key: ${{ runner.os }}-build-${{ env.cache-name }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}
- name: Cache backend
uses: Swatinem/rust-cache@v1.2.0
with:
working-directory: ./app/src-tauri
- name: Setup pnpm
uses: pnpm/action-setup@v2.0.1
with:
version: 6.0.2
- name: Setup tauri
run: cargo install tauri-cli --version ^1.0.0-beta
- name: Install webkit2gtk (ubuntu only)
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y webkit2gtk-4.0
- name: Build frontend
run: pnpm i && pnpm build
working-directory: ./app/src-ui
- name: Build backend
run: cargo tauri build
working-directory: ./app/
- name: Lint backend
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --manifest-path ./app/src-tauri/Cargo.toml
- name: Prerelease
uses: "marvinpinto/action-automatic-releases@latest"
if: "!startsWith(github.ref, 'refs/tags/')"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "Prerelease"
prerelease: true
title: "Development Build - May be unstable"
files: ./app/src-tauri/target/release/bundle/**/tic-tac-toe*.*
- name: Release
uses: "marvinpinto/action-automatic-releases@latest"
if: startsWith(github.ref, 'refs/tags/')
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
./app/src-tauri/target/release/bundle/**/tic-tac-toe*.dmg
./app/src-tauri/target/release/bundle/**/tic-tac-toe*.msi
./app/src-tauri/target/release/bundle/**/tic-tac-toe*.dmgas