mirror of
https://github.com/dotwee/obsidian-raindropio-plugin.git
synced 2026-07-22 17:00:29 +00:00
54 lines
1.3 KiB
YAML
54 lines
1.3 KiB
YAML
name: Release & Publish Obsidian Plugin
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "*"
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
id-token: write
|
|
attestations: write
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- name: Use Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: "20.x"
|
|
cache: "npm"
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Build plugin
|
|
run: npm run build
|
|
|
|
- name: Test plugin
|
|
run: npm test
|
|
|
|
- name: Lint plugin
|
|
run: npm run lint
|
|
|
|
- name: Verify release tag
|
|
run: |
|
|
node -e "const fs = require('fs'); const manifest = JSON.parse(fs.readFileSync('manifest.json', 'utf8')); const tag = process.env.GITHUB_REF_NAME; if (manifest.version !== tag) { console.error('Tag ' + tag + ' does not match manifest version ' + manifest.version); process.exit(1); }"
|
|
|
|
- name: Generate artifact attestation
|
|
uses: actions/attest@v4
|
|
with:
|
|
subject-path: |
|
|
main.js
|
|
manifest.json
|
|
styles.css
|
|
|
|
- name: Create release
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
gh release create "$GITHUB_REF_NAME" \
|
|
--title="$GITHUB_REF_NAME" \
|
|
main.js manifest.json styles.css
|