-
Notifications
You must be signed in to change notification settings - Fork 4
77 lines (64 loc) · 1.81 KB
/
Copy pathrelease.yml
File metadata and controls
77 lines (64 loc) · 1.81 KB
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
name: Release
on:
push:
tags:
- "v*.*.*"
workflow_dispatch:
permissions:
contents: write
concurrency:
group: release-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
desktop:
name: Build desktop package (${{ matrix.target }} ${{ matrix.arch }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
target: mac
arch: x64
- os: macos-latest
target: mac
arch: arm64
- os: windows-latest
target: win
arch: x64
- os: ubuntu-latest
target: linux
arch: x64
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.33.0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Verify tag matches package version
shell: bash
run: |
node <<'NODE'
const pkg = require('./package.json')
const tag = process.env.GITHUB_REF_NAME || ''
const version = tag.replace(/^v/, '')
if (version !== pkg.version) {
console.error(`Tag ${tag} does not match package.json version ${pkg.version}`)
process.exit(1)
}
NODE
- name: Build application
run: pnpm build
- name: Build packages and publish draft release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: pnpm exec electron-builder --${{ matrix.target }} --${{ matrix.arch }} --publish always