Skip to content

Commit a1516c9

Browse files
committed
ci: add tag-triggered Windows release workflow
Builds the ZIP on windows-latest and publishes to GitHub Releases via electron-builder's github provider. Tag a vX.Y.Z and the runner does the rest — no local cert/token juggling required.
1 parent ec0b1c7 commit a1516c9

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+
# Release workflow for Miqāt — builds the Windows ZIP and publishes
2+
# it to GitHub Releases. Triggered by pushing a `v*.*.*` tag, or by
3+
# clicking "Run workflow" in the Actions UI.
4+
#
5+
# Version source of truth is `electron/package.json`. Bump it, commit,
6+
# tag with the matching `vX.Y.Z`, push the tag — the workflow takes
7+
# over from there. electron-builder uses the tag's `GH_TOKEN` to create
8+
# the release and upload assets + the `latest.yml` file electron-updater
9+
# needs for in-app auto-updates.
10+
11+
name: Release
12+
13+
on:
14+
push:
15+
tags: ['v*.*.*']
16+
workflow_dispatch:
17+
inputs:
18+
tag:
19+
description: 'Tag to build (e.g. v1.0.1) — must already exist'
20+
required: true
21+
type: string
22+
23+
# Releases are sequential — never run two at once on the same tag.
24+
concurrency:
25+
group: release-${{ github.ref }}
26+
cancel-in-progress: false
27+
28+
permissions:
29+
# electron-builder needs to create the GitHub Release and upload
30+
# assets. The default GITHUB_TOKEN with `contents: write` is enough.
31+
contents: write
32+
33+
jobs:
34+
windows:
35+
name: Build · Sign · Publish (Windows)
36+
runs-on: windows-latest
37+
timeout-minutes: 30
38+
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@v4
42+
with:
43+
# If triggered manually with a tag input, check that ref out;
44+
# otherwise the tag push already provides the right ref.
45+
ref: ${{ inputs.tag || github.ref }}
46+
47+
- name: Setup Node 22
48+
uses: actions/setup-node@v4
49+
with:
50+
node-version: 22
51+
cache: npm
52+
53+
- name: Install dependencies
54+
run: npm ci --no-audit --no-fund
55+
56+
- name: Build all workspaces
57+
# server (nest) → client (vite) → electron (tsc). The release
58+
# script re-runs `npm run build` itself, but doing it here makes
59+
# the failure mode clearer if a workspace breaks.
60+
run: npm run build
61+
62+
- name: Package + publish
63+
# `npm run release` does:
64+
# 1. npm run build (no-op, already ran)
65+
# 2. electron install:prod-deps (production-only deps in electron/)
66+
# 3. electron-builder install-app-deps (rebuilds better-sqlite3
67+
# against Electron's Node ABI)
68+
# 4. electron-builder --publish=always (uploads to GH Releases
69+
# via the `github` provider in electron/package.json)
70+
env:
71+
# electron-builder reads GH_TOKEN, not GITHUB_TOKEN.
72+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+
run: npm run release
74+
75+
- name: Upload build artifact (debugging)
76+
# Keeps the unpacked dist around for 7 days in case a release
77+
# asset is malformed and we need to inspect it without rerunning.
78+
if: always()
79+
uses: actions/upload-artifact@v4
80+
with:
81+
name: miqaat-windows-${{ github.ref_name }}
82+
path: |
83+
electron/dist-build/*.zip
84+
electron/dist-build/latest.yml
85+
electron/dist-build/*.blockmap
86+
retention-days: 7
87+
if-no-files-found: warn

0 commit comments

Comments
 (0)