unabyss_obsidian-plugin/.github/workflows/release.yml
Dominik Bartosik f42aec27a0 fix: clear remaining Obsidian review errors (1.1.2)
- settings: drop app/plugin names from section headings
  ("Outbound sync" / "Inbound sync")
- manifest/versions: raise minAppVersion to 1.6.6, the release that
  introduced FileManager.trashFile (used by inbound delete), fixing
  obsidianmd/no-unsupported-api
- release CI: attest styles.css alongside main.js/manifest.json and add
  release notes (body + auto-generated changelog)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-15 03:10:33 +02:00

100 lines
3.5 KiB
YAML

name: Release Obsidian Plugin
# Triggered by pushing a SemVer tag (v*). Builds the production bundle
# and attaches only the files Obsidian downloads - main.js, manifest.json,
# and styles.css - to the GitHub Release. Obsidian ignores any other
# release assets, so none are attached.
#
# The Release is published under the BARE version tag (e.g. 1.1.0), not
# the pushed v-prefixed tag. Obsidian matches manifest.json "version"
# against a release tag with no "v" prefix, so the release must be 1.1.0
# even though the git trigger tag is v1.1.0.
on:
push:
tags:
- "v*"
permissions:
contents: write
id-token: write
attestations: write
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up pnpm
uses: pnpm/action-setup@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "pnpm"
cache-dependency-path: pnpm-lock.yaml
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Typecheck
run: pnpm run typecheck
- name: Run unit tests
run: pnpm test
- name: Build production bundle
run: pnpm run build
- name: Extract version from tag
id: version
run: |
TAG="${GITHUB_REF##*/}"
VERSION="${TAG#v}"
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
- name: Verify manifest version matches tag
run: |
MANIFEST_VERSION="$(node -e 'process.stdout.write(require("./manifest.json").version)')"
if [ "$MANIFEST_VERSION" != "${{ steps.version.outputs.version }}" ]; then
echo "manifest.json version ($MANIFEST_VERSION) does not match tag (${{ steps.version.outputs.version }})"
exit 1
fi
- name: Collect release artefacts
run: |
mkdir -p release
cp main.js manifest.json release/
if [ -f styles.css ]; then cp styles.css release/; fi
- name: Attest build provenance
uses: actions/attest-build-provenance@v2
with:
subject-path: |
release/main.js
release/manifest.json
release/styles.css
- name: Publish GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.version }}
name: Unabyss Obsidian Plugin ${{ steps.version.outputs.version }}
body: |
Unabyss plugin release ${{ steps.version.outputs.version }}.
Installable assets: `main.js`, `manifest.json`, `styles.css`.
Each is covered by a GitHub build provenance attestation.
generate_release_notes: true
draft: false
prerelease: false
files: |
release/main.js
release/manifest.json
release/styles.css
fail_on_unmatched_files: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}