-
Notifications
You must be signed in to change notification settings - Fork 0
169 lines (150 loc) · 5.87 KB
/
Copy pathrelease.yml
File metadata and controls
169 lines (150 loc) · 5.87 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
name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
tag:
description: 'Tag name to publish (e.g. v1.2.3). Leave blank to build artifacts only without creating a release.'
required: false
default: ''
permissions:
contents: write
# Run JS-based actions on Node 24 — silences the Node 20 deprecation warnings
# that GitHub will start enforcing in mid-2026.
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'
# Only one release run per ref at a time. Cancel older queued/active runs.
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
# pnpm must be set up before setup-node so `cache: pnpm` can find it.
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: 11
- name: Set up Node.js
uses: actions/setup-node@v4
with:
# pnpm 11.7+ requires Node >= 22.13 (it uses the node:sqlite builtin).
node-version: '22'
cache: 'pnpm'
# better-sqlite3 / electron-winstaller build scripts are pre-approved via
# allowBuilds in pnpm-workspace.yaml; --frozen-lockfile fails fast if the
# lockfile drifts from package.json. electron-builder (npmRebuild: true)
# rebuilds native modules for Electron's ABI during packaging.
- name: Install dependencies
run: pnpm install --frozen-lockfile
# electron-builder downloads its own WiX/Squirrel/etc helpers and caches
# them under ~/.cache/electron-builder. Caching saves ~30s per run.
- name: Cache electron-builder downloads
uses: actions/cache@v4
with:
path: |
~/.cache/electron
~/.cache/electron-builder
key: ${{ runner.os }}-electron-builder-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-electron-builder-
- name: Build Windows (NSIS + MSI + portable)
if: matrix.os == 'windows-latest'
run: pnpm run build:win -- --publish never
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# No code-signing certificate configured — disable signing so the
# build doesn't fail looking for one. Users will see a SmartScreen
# warning on first launch until a cert is added.
CSC_IDENTITY_AUTO_DISCOVERY: 'false'
- name: Build macOS (DMG x64 + arm64)
if: matrix.os == 'macos-latest'
run: pnpm run build:mac -- --publish never
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Skip signing + notarisation — Gatekeeper will warn on first open
# until an Apple Developer ID is configured here.
CSC_IDENTITY_AUTO_DISCOVERY: 'false'
- name: Build Linux (AppImage)
if: matrix.os == 'ubuntu-latest'
run: pnpm run build:linux -- --publish never
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: List build output
shell: bash
run: ls -lh dist/ || true
# Capture only the user-facing installers/binaries — skip the unpacked
# build trees (`*-unpacked/`, `*.blockmap`, etc).
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: includa-${{ matrix.os }}
if-no-files-found: error
retention-days: 14
path: |
dist/*.exe
dist/*.msi
dist/*.dmg
dist/*.AppImage
dist/latest*.yml
release:
name: Publish GitHub Release
needs: build
runs-on: ubuntu-latest
timeout-minutes: 10
# Only publish when triggered by a v* tag push, OR when manually dispatched
# with a tag input (so you can re-cut a release without retagging).
if: startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && inputs.tag != '')
steps:
- name: Download all build artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: List collected artifacts
run: ls -lh artifacts/
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ inputs.tag || github.ref_name }}
name: ${{ inputs.tag || github.ref_name }}
draft: true
prerelease: true
generate_release_notes: true
fail_on_unmatched_files: true
# Replace any same-named asset already attached (e.g. when re-pushing
# a moved tag to retrigger the build with bug fixes).
overwrite_files: true
body: |
## Downloads
| Platform | File | Notes |
|---|---|---|
| Windows | `*-Setup.exe` (NSIS) | Standard installer with Start Menu / uninstaller |
| Windows | `*.msi` | MSI installer for managed deployments |
| Windows | `*-portable.exe` | Single-file portable, no install needed |
| macOS (Intel) | `*-x64.dmg` | Drag-to-Applications |
| macOS (Apple Silicon) | `*-arm64.dmg` | Drag-to-Applications |
| Linux | `*.AppImage` | `chmod +x` then run |
> **First-run note:** Builds are not yet code-signed. Windows
> SmartScreen will warn — click "More info → Run anyway".
> macOS Gatekeeper will block — right-click → Open the first time.
> A Chromium engine (~300 MB) downloads on first scan.
files: |
artifacts/*.exe
artifacts/*.msi
artifacts/*.dmg
artifacts/*.AppImage
artifacts/latest*.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}