tea0s_multimuse-tracker/.github/workflows/release.yml
Tea ec86e60bfc 1.11.1
- Ribbon "New Scene" button
- added initilalization to the settings pane
- Fixed the long standing bug of new scene command breaking the front matter of a file if the file was active when doing the wizard
2026-05-16 13:27:03 -04:00

90 lines
2.7 KiB
YAML

name: Release
on:
push:
tags:
# Semver-style tags only (e.g. 1.11.0), not branch names like "Release"
- "[0-9]+.[0-9]+*"
workflow_dispatch:
permissions:
contents: write
attestations: write
id-token: write
jobs:
release:
name: Build and release plugin
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Resolve release version
id: version
run: |
MANIFEST_VERSION=$(node -p "require('./manifest.json').version")
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
VERSION="$MANIFEST_VERSION"
echo "Manual release from manifest.json: $VERSION"
else
VERSION="${GITHUB_REF_NAME}"
echo "Tag push release: $VERSION"
fi
if [ "$VERSION" != "$MANIFEST_VERSION" ]; then
echo "::error::Release version ($VERSION) does not match manifest.json ($MANIFEST_VERSION)"
exit 1
fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Install dependencies
run: npm ci
- name: Build plugin
run: npm run build
- name: Stage release assets
run: |
mkdir -p release
cp main.js manifest.json styles.css release/
- name: Generate artifact attestations
uses: actions/attest-build-provenance@v2
continue-on-error: true
with:
subject-path: |
release/main.js
release/manifest.json
release/styles.css
- name: Create GitHub release
env:
GH_TOKEN: ${{ github.token }}
run: |
VERSION="${{ steps.version.outputs.version }}"
ARGS=(
"$VERSION"
release/main.js
release/manifest.json
release/styles.css
--title "$VERSION"
--notes "Multimuse Tracker $VERSION"
)
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
ARGS+=(--target "${GITHUB_SHA}")
fi
if gh release view "$VERSION" >/dev/null 2>&1; then
echo "Release $VERSION already exists; uploading assets"
gh release upload "$VERSION" release/main.js release/manifest.json release/styles.css --clobber
else
gh release create "${ARGS[@]}"
fi
# Obsidian community validation requires the release *title* to include the manifest version (not just the tag).
gh release edit "$VERSION" --title "$VERSION" --notes "Multimuse Tracker $VERSION"