selectstarfromusers_obsidia.../.github/workflows/release.yml
Art Malanok 2780e7bb55 v0.1.5: address Obsidian Community scorecard findings
- styles.css: switch `text-decoration` shorthand to `text-decoration-line`
  longhand (silences Obsidian 1.9.12 partial-support warning).
- vault enumeration: replace `vault.getFiles()` + path-prefix filter in
  3 call sites (settings.ts, inlineTaskWatcher.ts, taskStore.ts) with
  a new `getMarkdownFilesInFolder(app, folderPath)` helper using
  `Vault.recurseChildren` scoped to the configured task folder. The
  plugin no longer enumerates the full vault — clears the scorecard
  "Vault Enumeration" finding.
- add `.github/workflows/release.yml` invoking
  `actions/attest-build-provenance@v2` so release assets carry
  GitHub-signed build attestations.
- commit `package-lock.json` for reproducible CI builds. This also
  unblocks Obsidian's automated build verification + malware scan.
- fix two preexisting `ReturnType<typeof setTimeout>` vs
  `activeWindow.setTimeout` (`number`) type mismatches surfaced by
  tsc --noEmit (settings.ts + taskView.ts).

Co-authored-by: Isaac
2026-05-27 16:54:09 -07:00

63 lines
2 KiB
YAML

name: Release
# Triggers when you push a SemVer tag like `0.1.4` (no `v` prefix — matches Obsidian
# community-plugin convention and the existing versions.json entries).
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
permissions:
contents: write # create release + upload assets
id-token: write # sign attestations
attestations: write # publish build provenance for release assets
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install dependencies
# When a package-lock.json is committed, switch this to `npm ci` for
# reproducible installs. Until then, `npm install` resolves against
# package.json on the fly.
run: npm install --no-audit --no-fund
- name: Build
run: npm run build
- name: Verify manifest version matches tag
run: |
MANIFEST_VERSION=$(node -p "require('./manifest.json').version")
TAG_VERSION="${GITHUB_REF_NAME}"
if [ "$MANIFEST_VERSION" != "$TAG_VERSION" ]; then
echo "::error::manifest.json version ($MANIFEST_VERSION) does not match tag ($TAG_VERSION)"
exit 1
fi
- name: Generate artifact attestations
# Attaches GitHub-signed build provenance to each release asset so the
# Obsidian community scanner's "release assets missing GitHub artifact
# attestation" finding clears.
uses: actions/attest-build-provenance@v2
with:
subject-path: |
main.js
manifest.json
styles.css
- name: Create GitHub release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "$GITHUB_REF_NAME" \
--title "$GITHUB_REF_NAME" \
--generate-notes \
main.js manifest.json styles.css