refactor!: retire wails.json, config.yml is the version source
- version.go (generated, never hand-edited) carries the compiled-in version; app.go drops the wails.json embed plus the gjson dependency - make release bumps config.yml and regenerates version.go in one commit; the re-run-safe guards from the 1.99.1 cycle carry over - release guard reads config.yml; CI CLI pin and cache key move to beta.22 to match the lockstep above - release wrapper and config NOTE comments updated; deletion proof: wails3 build green plus a dev boot reaching the connected state with the file absent (the one cold-boot failure reproduced as a Vite 8 cold-start vs app retry race, cleared by rerunning warm)
This commit is contained in:
@@ -12,9 +12,10 @@ run-name: "Release ${{ gitea.event.inputs.tag || gitea.ref_name }}"
|
||||
# work-in-progress commits never ship.
|
||||
#
|
||||
# Local flow: `./release 1.6.7` (or `make release VERSION=1.6.7`) bumps
|
||||
# wails.json, commits the bump, creates an annotated tag carrying the
|
||||
# git-cliff notes, and pushes commit + tag. This workflow verifies
|
||||
# wails.json matches the tag before building.
|
||||
# build/config.yml (and the generated version.go), commits the bump,
|
||||
# creates an annotated tag carrying the git-cliff notes, and pushes
|
||||
# commit + tag. This workflow verifies build/config.yml matches the tag
|
||||
# before building.
|
||||
#
|
||||
# Secrets test (verifies environment.go wiring without shipping): tag the
|
||||
# current bumped commit with a suffix and push, e.g.
|
||||
@@ -49,7 +50,7 @@ jobs:
|
||||
fetch-depth: 0
|
||||
ref: ${{ gitea.event.inputs.tag || gitea.ref }}
|
||||
|
||||
- name: Guard wails.json matches tag
|
||||
- name: Guard build/config.yml matches tag
|
||||
run: |
|
||||
set -euo pipefail
|
||||
: "${TAG:?TAG is required}"
|
||||
@@ -58,21 +59,21 @@ jobs:
|
||||
NORM="${TAG#v}"
|
||||
NORM="${NORM#AniTrack-}"
|
||||
BASE="${NORM%%-*}"
|
||||
WAILS_VER="$(python3 -c "import json; print(json.load(open('wails.json'))['info']['productVersion'])")"
|
||||
CFG_VER="$(python3 -c "import re; print(re.search(r'^ version: \"([^\"]*)\"', open('build/config.yml').read(), flags=re.M).group(1))")"
|
||||
if [ "${NORM}" = "${BASE}" ]; then
|
||||
if [ "${WAILS_VER}" != "${NORM}" ]; then
|
||||
echo "::error::wails.json productVersion (${WAILS_VER}) != tag (${NORM}). Bump via ./release ${NORM} first." >&2
|
||||
if [ "${CFG_VER}" != "${NORM}" ]; then
|
||||
echo "::error::build/config.yml info.version (${CFG_VER}) != tag (${NORM}). Bump via ./release ${NORM} first." >&2
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
# Pre-release (e.g. 1.6.7-rc1): wails.json must match the base version.
|
||||
if [ "${WAILS_VER}" != "${BASE}" ]; then
|
||||
echo "::error::wails.json productVersion (${WAILS_VER}) != tag base (${BASE}). Bump via ./release ${BASE} first." >&2
|
||||
# Pre-release (e.g. 1.6.7-rc1): build/config.yml must match the base version.
|
||||
if [ "${CFG_VER}" != "${BASE}" ]; then
|
||||
echo "::error::build/config.yml info.version (${CFG_VER}) != tag base (${BASE}). Bump via ./release ${BASE} first." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
echo "VERSION=${NORM}" >> "${GITHUB_ENV}"
|
||||
echo "Version guard passed: wails.json=${WAILS_VER} tag=${NORM}"
|
||||
echo "Version guard passed: build/config.yml=${CFG_VER} tag=${NORM}"
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
@@ -119,13 +120,13 @@ jobs:
|
||||
# The compiled CLI binary. Bump the key whenever the @version pin
|
||||
# below changes, or the old CLI will be silently reused.
|
||||
path: ~/go/bin/wails3
|
||||
key: wails3-v3.0.0-beta.20-${{ runner.os }}
|
||||
key: wails3-v3.0.0-beta.22-${{ runner.os }}
|
||||
|
||||
- name: Install Wails CLI
|
||||
if: steps.wails-cli.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
set -euo pipefail
|
||||
go install github.com/wailsapp/wails/v3/cmd/wails3@v3.0.0-beta.20
|
||||
go install github.com/wailsapp/wails/v3/cmd/wails3@v3.0.0-beta.22
|
||||
|
||||
- name: Add Go bin to PATH
|
||||
run: echo "${HOME}/go/bin" >> "${GITHUB_PATH}"
|
||||
|
||||
Reference in New Issue
Block a user