ci: release automatically when master carries an unreleased package.json version

On push to master the workflow now checks whether tag v<version> exists and,
if not, creates the tag and the GitHub release with the Windows installer.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Wn5VX9HNbJ7N54hR24u9Y
This commit is contained in:
Claude committed 2026-09-03 13:56:32 +00:00
1 parent 8ee34b9932
commit eec6d62c20
1 file changed
+9 -2
+9 -2
View File
@@ -42,7 +42,14 @@ jobs:
- name: Read version
id: ver
shell: bash
run: echo "version=$(node -p "require('./package.json').version")" >> "$GITHUB_OUTPUT"
run: |
version=$(node -p "require('./package.json').version")
echo "version=$version" >> "$GITHUB_OUTPUT"
if git ls-remote --exit-code --tags origin "refs/tags/v$version" >/dev/null 2>&1; then
echo "released=true" >> "$GITHUB_OUTPUT"
else
echo "released=false" >> "$GITHUB_OUTPUT"
fi
- run: npm run build
- name: Package Windows EXE
run: npx electron-builder --win --publish never
@@ -57,7 +64,7 @@ jobs:
out/latest.yml
if-no-files-found: error
- name: Publish GitHub release
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/master' && steps.ver.outputs.released == 'false')
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.ver.outputs.version }}