mirror of
https://github.com/lllin000/PaperForge.git
synced 2026-07-22 06:50:53 +00:00
After TS migration, main.js is now a build artifact from src/main.ts. Both workflows must build the plugin before creating the release artifact.
47 lines
1.1 KiB
YAML
47 lines
1.1 KiB
YAML
# Auto-release Obsidian plugin on tag push
|
|
# Triggered by tags like v1.4.18. Runs plugin tests, then creates a GitHub Release
|
|
# with the 4 required Obsidian plugin files.
|
|
|
|
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
- '[0-9]*'
|
|
|
|
jobs:
|
|
release:
|
|
name: Release Plugin
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: "npm"
|
|
cache-dependency-path: paperforge/plugin/package-lock.json
|
|
|
|
- name: Run plugin tests
|
|
working-directory: paperforge/plugin
|
|
run: |
|
|
npm ci
|
|
npx vitest run --reporter=verbose
|
|
|
|
- name: Build plugin bundle
|
|
working-directory: paperforge/plugin
|
|
run: npm run build
|
|
|
|
- name: Create Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
name: ${{ github.ref_name }}
|
|
generate_release_notes: true
|
|
files: |
|
|
paperforge/plugin/main.js
|
|
paperforge/plugin/styles.css
|
|
paperforge/plugin/manifest.json
|
|
paperforge/plugin/versions.json
|