-
Notifications
You must be signed in to change notification settings - Fork 1
237 lines (197 loc) · 6.95 KB
/
Copy pathrelease.yml
File metadata and controls
237 lines (197 loc) · 6.95 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
name: Build and Release
on:
push:
tags:
- 'v*'
permissions:
contents: read
jobs:
build-windows:
runs-on: windows-latest
permissions:
contents: read
steps:
- name: Check out Git repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
- name: Install Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f
with:
node-version: 20
package-manager-cache: false
- name: Install dependencies
run: npm ci
- name: Prepare build
run: node scripts/prepare-build.js windows
- name: Build CSS
run: npm run build:css
- name: Build Webpack
run: npm run build:webpack
- name: Build Windows Package
run: npm run build:win -- --publish=never
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Windows Artifacts
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
with:
name: windows-artifacts
path: |
dist/*.exe
dist/*.msi
dist/*.yml
dist/*.blockmap
retention-days: 5
build-linux:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Check out Git repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
- name: Install Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f
with:
node-version: 20
package-manager-cache: false
- name: Install dependencies
run: npm ci
- name: Install required system packages
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libnotify-dev libnss3 libxss1 libgbm-dev
# Skip prepare-build for Linux as it seems to be causing issues
# Instead, directly modify package.json for Linux build
- name: Configure Linux Build
run: |
# Create a minimal electron-builder config for Linux
node -e "
const fs = require('fs');
const path = require('path');
const packageJsonPath = path.join(process.cwd(), 'package.json');
const packageJson = require(packageJsonPath);
// Remove any existing Linux configuration
if (packageJson.build && packageJson.build.linux) {
delete packageJson.build.linux;
}
// Set minimal Linux config without any icon reference
if (!packageJson.build) packageJson.build = {};
packageJson.build.linux = {
target: ['AppImage'],
category: 'Utility'
};
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2) + '\n');
"
- name: Build CSS
run: npm run build:css
- name: Build Webpack
run: npm run build:webpack
- name: Build Linux AppImage
run: npm run build -- --linux AppImage --publish=never
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Linux Artifacts
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
with:
name: linux-artifacts
path: |
dist/*.AppImage
dist/*.AppImage.zsync
dist/*.yml
dist/*.blockmap
retention-days: 5
build-macos:
runs-on: macos-latest
permissions:
contents: read
steps:
- name: Check out Git repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
- name: Install Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f
with:
node-version: 20
package-manager-cache: false
- name: Install dependencies
run: npm ci
- name: Prepare build
run: node scripts/prepare-build.js mac
- name: Build CSS
run: npm run build:css
- name: Build Webpack
run: npm run build:webpack
- name: Build macOS Universal Binary
run: npm run build:mac-universal -- --publish=never
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload macOS Artifacts
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
with:
name: macos-artifacts
path: |
dist/*.dmg
dist/*.zip
dist/*.yml
dist/*.blockmap
retention-days: 5
create-release:
needs: [build-windows, build-linux, build-macos]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out Git repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
fetch-depth: 0
persist-credentials: false
- name: Get version from tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Validate tag matches package version
run: |
TAG_VERSION="${{ steps.get_version.outputs.VERSION }}"
TAG_VERSION="${TAG_VERSION#v}"
PACKAGE_VERSION="$(node -p "require('./package.json').version")"
if [[ "${TAG_VERSION}" != "${PACKAGE_VERSION}" ]]; then
echo "::error::Tag version (${TAG_VERSION}) does not match package.json version (${PACKAGE_VERSION})."
exit 1
fi
- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@32aa5b4c155d76c94e4ec883a223c947b2f02656
with:
validation_level: warn
path: ./CHANGELOG.md
version: ${{ steps.get_version.outputs.VERSION }}
continue-on-error: true
- name: Download Windows artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
with:
name: windows-artifacts
path: artifacts/windows
- name: Download Linux artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
with:
name: linux-artifacts
path: artifacts/linux
- name: Download macOS artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
with:
name: macos-artifacts
path: artifacts/macos
- name: Create Release
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe
with:
name: Release ${{ steps.get_version.outputs.VERSION }}
body: ${{ steps.changelog_reader.outputs.changes || 'No changelog provided' }}
draft: ${{ !contains(steps.get_version.outputs.VERSION, '-alpha') }}
prerelease: ${{ contains(steps.get_version.outputs.VERSION, '-alpha') }}
files: |
artifacts/**
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}