Release workflow: publish suffixed tags (alpha/beta) as GitHub prereleases

A tag containing a "-" now stamps its version into the *published*
manifest.json only (master stays at the last stable version) and sets
prerelease: true, so the official updater and community review never see
it while BRAT / manual install can. Process docs: RELEASING.md
"Pre-release (alpha/beta) builds".

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
WiseGuru 2026-07-09 20:55:24 -07:00
parent 437aa5e050
commit 01e3fb8d75

View file

@ -2,6 +2,10 @@ name: Release
# Build, attest provenance, and publish release assets when a version tag is pushed.
# Obsidian tags are bare versions with no leading "v" (e.g. 1.0.0).
# A tag carrying a pre-release suffix (a "-", e.g. 1.3.0-alpha / 1.3.0-beta.1) is
# published as a GitHub *prerelease*: GitHub's "latest release" (what Obsidian's
# updater reads) excludes prereleases, so the official channel never sees it, while
# BRAT / manual install still can. See docs/RELEASING.md.
on:
push:
tags:
@ -28,6 +32,33 @@ jobs:
- name: Install dependencies
run: npm ci
# A tag with a "-" (e.g. 1.3.0-alpha) is a pre-release channel.
- name: Determine release channel
id: channel
shell: bash
run: |
if [[ "${{ github.ref_name }}" == *-* ]]; then
echo "prerelease=true" >> "$GITHUB_OUTPUT"
else
echo "prerelease=false" >> "$GITHUB_OUTPUT"
fi
# Master's manifest.json stays at the last stable version during alpha/beta
# testing, so stamp the tag's version into the *published* manifest only.
# (Stable tags publish manifest.json as committed; this step is skipped.)
- name: Stamp pre-release version into manifest
if: steps.channel.outputs.prerelease == 'true'
shell: bash
env:
TAG: ${{ github.ref_name }}
run: |
node -e '
const fs = require("fs");
const m = JSON.parse(fs.readFileSync("manifest.json", "utf8"));
m.version = process.env.TAG;
fs.writeFileSync("manifest.json", JSON.stringify(m, null, "\t"));
'
- name: Build
run: npm run build
@ -44,6 +75,7 @@ jobs:
with:
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
prerelease: ${{ steps.channel.outputs.prerelease }}
files: |
main.js
manifest.json