1.5 KiB
1.5 KiB
You are helping the user set up GitHub Actions for releasing their Obsidian plugin.
-
Verify prerequisites:
- Plugin has a git repository
- GitHub repository is created
- manifest.json is properly configured
- package.json version matches manifest.json
-
Create release workflow:
- Create .github/workflows/release.yml
- Configure workflow to trigger on version tags
- Set up Node.js build environment
- Run build process
- Create GitHub release with built artifacts
-
Create necessary files:
- versions.json to track version history
- version-bump.mjs script to sync versions
- Update package.json scripts
-
Provide release instructions:
- How to update version numbers
- How to create git tags
- How to push tags to trigger release
- What files need to be updated
Use this workflow template:
name: Release Obsidian plugin
on:
push:
tags:
- "*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.x"
- run: npm ci
- run: npm run build
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "${{ github.ref_name }}" \
--title "${{ github.ref_name }}" \
--draft \
main.js manifest.json styles.css
Reference: https://docs.obsidian.md/Plugins/Releasing/Release+your+plugin+with+GitHub+Actions