aaronsb_obsidian-mcp-plugin/.github/workflows/release.yml
Aaron Bockelie 43d83ed061 fix(ci): attest styles.css and manifest.json, not just main.js
Follow-up to #164. Obsidian's portal flags every installable release asset
lacking a build-provenance attestation. #164 attested main.js + the .mcpb
bundles but missed styles.css and manifest.json, leaving a standing
'styles.css release asset does not have a GitHub artifact attestation'
recommendation. Attest the full installable set.
2026-05-16 12:25:13 -05:00

102 lines
No EOL
3 KiB
YAML

name: Create Release
on:
workflow_dispatch:
inputs:
release_notes:
description: 'Additional release notes (optional)'
required: false
type: string
env:
PLUGIN_NAME: obsidian-mcp-plugin
permissions:
contents: write
id-token: write # required for build-provenance attestation (#164)
attestations: write # required for build-provenance attestation (#164)
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0 # Fetch full history for version bumping
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version: '20'
- name: Install dependencies
run: npm ci
- name: Lint code
run: npm run lint
- name: Run tests
run: npm run test
- name: Build plugin
run: npm run build
- name: Build MCPB bundle
run: node scripts/build-mcpb.mjs
- name: Get version from manifest
id: version
run: |
echo "version=$(jq -r '.version' manifest.json)" >> $GITHUB_OUTPUT
echo "name=$(jq -r '.name' manifest.json)" >> $GITHUB_OUTPUT
- name: Check if version tag exists
id: check_tag
run: |
if git rev-parse "${{ steps.version.outputs.version }}" >/dev/null 2>&1; then
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "exists=false" >> $GITHUB_OUTPUT
fi
- name: Attest build provenance
if: steps.check_tag.outputs.exists == 'false'
uses: actions/attest-build-provenance@v2
with:
# Attest every asset Obsidian installs (main.js, manifest.json,
# styles.css) plus the .mcpb bundles. The portal flags any
# installable asset lacking attestation — #164 originally missed
# styles.css/manifest.json.
subject-path: |
main.js
manifest.json
styles.css
obsidian-mcp-${{ steps.version.outputs.version }}.mcpb
obsidian-mcp.mcpb
- name: Create Release
if: steps.check_tag.outputs.exists == 'false'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
NOTES="## ${{ steps.version.outputs.name }} ${{ steps.version.outputs.version }}
${{ inputs.release_notes }}
### Installation via BRAT
1. Install the BRAT plugin if you haven't already
2. Command palette → \"BRAT: Add a beta plugin for testing\"
3. Enter: \`aaronsb/obsidian-mcp-plugin\`
4. Enable the plugin in Community Plugins"
gh release create "${{ steps.version.outputs.version }}" \
--title "${{ steps.version.outputs.name }} ${{ steps.version.outputs.version }}" \
--generate-notes \
--notes "$NOTES" \
--prerelease \
main.js \
manifest.json \
styles.css \
"obsidian-mcp-${{ steps.version.outputs.version }}.mcpb" \
obsidian-mcp.mcpb