-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (77 loc) · 2.21 KB
/
publish.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
93
94
95
96
name: Publish
on:
release:
types: [published]
jobs:
build-tauri:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: setup node
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
- name: install rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: install dependencies (ubuntu only)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
- name: rust cache
uses: Swatinem/rust-cache@v2
with:
working-directory: src-tauri
- name: yarn install
run: yarn install --frozen-lockfile
- name: build
run: yarn build
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
with:
releaseId: ${{ github.event.release.id }}
publish-release:
runs-on: ubuntu-latest
needs: build-tauri
steps:
- name: publish release
id: publish-release
uses: actions/github-script@v6
env:
release_id: ${{ github.event.release.id }}
with:
script: |
github.rest.repos.updateRelease({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: process.env.release_id,
draft: false,
prerelease: false
})
release-update:
needs: publish-release
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: setup node
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
- name: yarn install
run: yarn install
- name: release update file
run: yarn node scripts/release.mjs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}