Skip to content

Commit 4dbe06e

Browse files
committed
feat: github release
1 parent 92119af commit 4dbe06e

1 file changed

Lines changed: 87 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Release
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
push:
8+
tags:
9+
- 'v*'
10+
workflow_dispatch:
11+
12+
jobs:
13+
create-release:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 0
19+
- name: Set output
20+
id: vars
21+
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
22+
23+
- name: Setup node
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version: 16.x
27+
28+
- name: Generate changelog
29+
id: create_release
30+
run: npx changelogithub --draft --name pntools-${{ steps.vars.outputs.tag }}
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
34+
build-app:
35+
needs: create-release
36+
strategy:
37+
fail-fast: false
38+
matrix:
39+
platform: [macos-latest, ubuntu-20.04, windows-latest]
40+
41+
runs-on: ${{ matrix.platform }}
42+
43+
steps:
44+
- name: Checkout repository
45+
uses: actions/checkout@v3
46+
- uses: pnpm/action-setup@v2
47+
with:
48+
version: latest
49+
50+
- name: install dependencies (ubuntu only)
51+
if: matrix.platform == 'ubuntu-20.04'
52+
run: |
53+
sudo apt-get update
54+
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev
55+
56+
- name: install dependencies (mac only)
57+
if: matrix.platform == 'macos-latest'
58+
run: |
59+
rustup target add aarch64-apple-darwin
60+
61+
- name: Install Rust stable
62+
uses: dtolnay/rust-toolchain@stable
63+
64+
- name: Rust cache
65+
uses: swatinem/rust-cache@v2
66+
with:
67+
workspaces: './src-tauri -> target'
68+
69+
- name: Sync node version and setup cache
70+
uses: actions/setup-node@v3
71+
with:
72+
node-version: '16'
73+
cache: 'pnpm'
74+
75+
- name: Install app dependencies and build web
76+
run: pnpm install --frozen-lockfile
77+
78+
- name: Build the app
79+
uses: tauri-apps/tauri-action@v0
80+
env:
81+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82+
with:
83+
tagName: ${{ github.ref_name }}
84+
releaseName: pntools ${{ needs.create-release.outputs.APP_VERSION }}
85+
releaseBody: ''
86+
releaseDraft: true
87+
prerelease: false

0 commit comments

Comments
 (0)