mirror of
https://github.com/jalad25/contact-note.git
synced 2026-07-22 06:53:06 +00:00
56 lines
1.3 KiB
YAML
56 lines
1.3 KiB
YAML
name: Release Obsidian Plugin
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "*"
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
id-token: write
|
|
attestations: write
|
|
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
|
|
- name: Validate tag matches manifest version
|
|
run: |
|
|
tag="${GITHUB_REF#refs/tags/}"
|
|
manifest_version=$(node -e "console.log(require('./manifest.json').version)")
|
|
|
|
if [ "$tag" != "$manifest_version" ]; then
|
|
echo "Tag ($tag) does not match manifest.json version ($manifest_version)"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Use Node.js
|
|
uses: actions/setup-node@v5
|
|
with:
|
|
node-version: "24.x"
|
|
|
|
- name: Build plugin
|
|
run: |
|
|
npm install
|
|
npm run build
|
|
|
|
- name: Attest release assets
|
|
uses: actions/attest-build-provenance@v2
|
|
with:
|
|
subject-path: |
|
|
main.js
|
|
manifest.json
|
|
styles.css
|
|
|
|
- name: Create release
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
tag="${GITHUB_REF#refs/tags/}"
|
|
|
|
gh release create "$tag" \
|
|
--title "$tag" \
|
|
--generate-notes \
|
|
main.js manifest.json styles.css
|