-
Notifications
You must be signed in to change notification settings - Fork 237
131 lines (112 loc) · 3.25 KB
/
Copy pathrelease.yml
File metadata and controls
131 lines (112 loc) · 3.25 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Release Electron App
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
tag:
description: "Tag to release (e.g. v1.0.11)"
required: true
type: string
permissions:
contents: write
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
platform: win
artifact: windows
- os: macos-latest
platform: mac
artifact: macos
- os: ubuntu-latest
platform: linux
artifact: linux
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag || github.ref }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install root dependencies
run: npm ci --ignore-scripts
- name: Setup curl-impersonate
run: npx tsx scripts/setup-curl.ts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install web dependencies
run: cd web && npm ci
- name: Install desktop dependencies
run: cd desktop && npm ci
- name: Build app
run: npm run app:build
- name: Pack (${{ matrix.platform }})
run: npx electron-builder --config electron-builder.yml --${{ matrix.platform }} --publish never
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: release-${{ matrix.artifact }}
path: |
release/*.exe
release/*.dmg
release/*.AppImage
release/*.yml
release/*.yaml
if-no-files-found: ignore
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v') || inputs.tag
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag || github.ref }}
fetch-depth: 0
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Resolve tag
id: tag
run: |
TAG="${{ inputs.tag || github.ref_name }}"
echo "name=$TAG" >> "$GITHUB_OUTPUT"
- name: Generate release notes
id: notes
run: |
TAG="${{ steps.tag.outputs.name }}"
PREV_TAG=$(git tag --sort=-v:refname | grep '^v' | grep -v "^${TAG}$" | head -1)
if [ -z "$PREV_TAG" ]; then
BODY="Initial release"
else
BODY=$(git log "${PREV_TAG}..${TAG}" --no-merges --pretty=format:"%s" \
| grep -vE "^(chore|docs|ci)(\(.*\))?:" \
| sed 's/^/- /')
if [ -z "$BODY" ]; then
BODY="Bug fixes and improvements"
fi
fi
{
echo "NOTES<<EOFNOTES"
echo "$BODY"
echo "EOFNOTES"
} >> "$GITHUB_OUTPUT"
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.tag.outputs.name }}
body: ${{ steps.notes.outputs.NOTES }}
draft: false
prerelease: false
files: artifacts/*