Skip to content

Commit d6979a6

Browse files
noahlzclaude
andcommitted
Add ad-hoc dev builds, release version hygiene, and bump to v0.2.0
- workflow_dispatch build computes a timestamped dev semver (e.g. 0.2.0-dev.20260316.225201) - _build-artifacts accepts optional version input to patch package.json before packaging - Simplified artifact upload names to ligeon-{mac,win,linux} - Release workflow verifies pushed tag matches package.json version before building - Fix electron-builder.json: notarize changed to boolean (electron-builder 26.8.1 schema change) - Bump package.json version 0.1.0 → 0.2.0 Co-Authored-By: Claude Code <noreply@anthropic.com> Claude-Cost-Metrics: {"method":"inc","cost":[{"model":"claude-sonnet-4-6","cost":0.77,"in":56,"out":4940,"cacheWrites":"79k","cacheReads":"1339k"}],"since":"2026-03-16T22:10:53-04:00","sessionId":"-Users-noahlz-projects-ligeon"}
1 parent 1055c45 commit d6979a6

File tree

5 files changed

+60
-22
lines changed

5 files changed

+60
-22
lines changed

.github/workflows/_build-artifacts.yml

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ name: Build Artifacts (reusable)
22

33
on:
44
workflow_call:
5+
inputs:
6+
version:
7+
description: 'Override package.json version (e.g. for ad-hoc dev builds)'
8+
type: string
9+
required: false
10+
default: ''
511

612
jobs:
713
test:
@@ -33,18 +39,19 @@ jobs:
3339
- run: npm ci
3440
- run: npm run build
3541
- run: npm run rebuild:electron
42+
- name: Set build version
43+
if: inputs.version != ''
44+
run: node -e "const fs=require('fs'); const p=JSON.parse(fs.readFileSync('package.json','utf8')); p.version='${{ inputs.version }}'; fs.writeFileSync('package.json', JSON.stringify(p, null, 2)+'\n');"
3645
- run: npx electron-builder --mac --universal --publish never
3746
env:
3847
CSC_LINK: ${{ secrets.CSC_LINK }}
3948
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
4049
APPLE_ID: ${{ secrets.APPLE_ID }}
4150
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
42-
- name: Get version
43-
id: version
44-
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
51+
APPLE_TEAM_ID: 2R45ZG5BZL
4552
- uses: actions/upload-artifact@v4
4653
with:
47-
name: Ligeon-${{ steps.version.outputs.version }}-mac
54+
name: ligeon-mac
4855
path: |
4956
release/*.dmg
5057
release/*.blockmap
@@ -65,16 +72,13 @@ jobs:
6572
- run: npm ci
6673
- run: npm run build
6774
- run: npm run rebuild:electron
75+
- name: Set build version
76+
if: inputs.version != ''
77+
run: node -e "const fs=require('fs'); const p=JSON.parse(fs.readFileSync('package.json','utf8')); p.version='${{ inputs.version }}'; fs.writeFileSync('package.json', JSON.stringify(p, null, 2)+'\n');"
6878
- run: npx electron-builder --win --publish never
69-
- name: Get version
70-
id: version
71-
run: |
72-
$ver = node -p "require('./package.json').version"
73-
"version=$ver" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
74-
shell: pwsh
7579
- uses: actions/upload-artifact@v4
7680
with:
77-
name: Ligeon-${{ steps.version.outputs.version }}-win
81+
name: ligeon-win
7882
path: |
7983
release/*.exe
8084
release/*.blockmap
@@ -94,13 +98,13 @@ jobs:
9498
- run: npm ci
9599
- run: npm run build
96100
- run: npm run rebuild:electron
101+
- name: Set build version
102+
if: inputs.version != ''
103+
run: node -e "const fs=require('fs'); const p=JSON.parse(fs.readFileSync('package.json','utf8')); p.version='${{ inputs.version }}'; fs.writeFileSync('package.json', JSON.stringify(p, null, 2)+'\n');"
97104
- run: npx electron-builder --linux --publish never
98-
- name: Get version
99-
id: version
100-
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
101105
- uses: actions/upload-artifact@v4
102106
with:
103-
name: Ligeon-${{ steps.version.outputs.version }}-linux
107+
name: ligeon-linux
104108
path: |
105109
release/*.AppImage
106110
if-no-files-found: error

.github/workflows/build.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,23 @@ on:
44
workflow_dispatch:
55

66
jobs:
7+
prepare:
8+
name: Prepare
9+
runs-on: ubuntu-latest
10+
outputs:
11+
version: ${{ steps.ver.outputs.version }}
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Compute build version
15+
id: ver
16+
run: |
17+
BASE=$(node -p "require('./package.json').version")
18+
STAMP=$(date -u +%Y%m%d.%H%M%S)
19+
echo "version=${BASE}-dev.${STAMP}" >> $GITHUB_OUTPUT
20+
721
build:
22+
needs: prepare
823
uses: ./.github/workflows/_build-artifacts.yml
24+
with:
25+
version: ${{ needs.prepare.outputs.version }}
26+
secrets: inherit

.github/workflows/release.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,26 @@ permissions:
99
contents: write
1010

1111
jobs:
12+
verify-version:
13+
name: Verify tag matches package.json version
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Check tag vs package.json
18+
run: |
19+
TAG_VERSION="${{ github.ref_name }}"
20+
PKG_VERSION="v$(node -p "require('./package.json').version")"
21+
if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
22+
echo "❌ Tag '$TAG_VERSION' does not match package.json version '$PKG_VERSION'."
23+
echo " Fix: update package.json version to match the tag, or re-tag the correct commit."
24+
exit 1
25+
fi
26+
echo "✅ Tag '$TAG_VERSION' matches package.json version."
27+
1228
build:
29+
needs: verify-version
1330
uses: ./.github/workflows/_build-artifacts.yml
31+
secrets: inherit
1432

1533
release:
1634
name: Create GitHub Release
@@ -19,15 +37,15 @@ jobs:
1937
steps:
2038
- uses: actions/download-artifact@v4
2139
with:
22-
name: release-mac
40+
name: ligeon-mac
2341
path: release-artifacts
2442
- uses: actions/download-artifact@v4
2543
with:
26-
name: release-win
44+
name: ligeon-win
2745
path: release-artifacts
2846
- uses: actions/download-artifact@v4
2947
with:
30-
name: release-linux
48+
name: ligeon-linux
3149
path: release-artifacts
3250
- uses: softprops/action-gh-release@v2
3351
with:

electron-builder.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@
2121
"target": ["dmg"],
2222
"category": "public.app-category.games",
2323
"icon": "resources/icons/mac/icon.icns",
24-
"notarize": {
25-
"teamId": "2R45ZG5BZL"
26-
}
24+
"notarize": true
2725
},
2826
"win": {
2927
"target": ["nsis"],

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Ligeon",
3-
"version": "0.1.0",
3+
"version": "0.2.0",
44
"type": "module",
55
"description": "Browse and replay chess games from PGN databases",
66
"author": "Noah Zucker",

0 commit comments

Comments
 (0)