mirror of
https://github.com/jcmexdev/obsidian-image-hoist.git
synced 2026-07-22 06:51:04 +00:00
53 lines
No EOL
1.3 KiB
YAML
53 lines
No EOL
1.3 KiB
YAML
name: Release Obsidian plugin
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "*"
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
id-token: write
|
|
attestations: write
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Use Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "20.x"
|
|
cache: "npm"
|
|
|
|
- name: Build plugin
|
|
run: |
|
|
npm ci
|
|
npm run build
|
|
|
|
- name: List files (Debug)
|
|
run: ls -lh main.js manifest.json styles.css
|
|
|
|
- name: Generate artifact attestation
|
|
uses: actions/attest-build-provenance@v2
|
|
with:
|
|
subject-path: |
|
|
main.js
|
|
manifest.json
|
|
styles.css
|
|
|
|
- name: Create or Update release
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
tag="${GITHUB_REF#refs/tags/}"
|
|
|
|
# Create release if it doesn't exist (ignore error if it does)
|
|
gh release create "$tag" \
|
|
--title="$tag" \
|
|
--draft \
|
|
--generate-notes || echo "Release already exists"
|
|
|
|
# Upload files individually, overwriting if they exist
|
|
gh release upload "$tag" main.js manifest.json styles.css --clobber |