mirror of
https://github.com/alberti42/obsidian-plugins-annotations.git
synced 2026-07-22 10:10:24 +00:00
- versions.json — added "1.7.10": "1.5.0" so the current version is represented; npm version will keep it updated from here on - .github/workflows/release.yml — new file; triggers on any X.Y.Z tag, builds the plugin, uses the matching release-notes/release-X.Y.Z.md (or generates a placeholder), appends a full-changelog link, and creates a draft release with dist/main.js, dist/manifest.json, dist/styles.css To cut a release going forward: npm version patch # or minor / major / explicit version git push && git push --tags Then review and publish the draft on GitHub.
50 lines
1.3 KiB
YAML
50 lines
1.3 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- '[0-9]+.[0-9]+.[0-9]+'
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
|
|
- run: npm ci
|
|
|
|
- run: npm run build
|
|
|
|
- name: Prepare release notes
|
|
run: |
|
|
VERSION="${GITHUB_REF_NAME}"
|
|
NOTES="release-notes/release-${VERSION}.md"
|
|
if [ ! -f "$NOTES" ]; then
|
|
echo "No release notes provided for version ${VERSION}." > "$NOTES"
|
|
fi
|
|
PREV_TAG=$(git tag --sort=-version:refname | grep -A1 "^${VERSION}$" | tail -1)
|
|
if [ -n "$PREV_TAG" ] && [ "$PREV_TAG" != "$VERSION" ]; then
|
|
echo "" >> "$NOTES"
|
|
echo "**Full changelog**: https://github.com/${{ github.repository }}/compare/${PREV_TAG}...${VERSION}" >> "$NOTES"
|
|
fi
|
|
|
|
- uses: softprops/action-gh-release@v2
|
|
with:
|
|
name: ${{ github.ref_name }}
|
|
body_path: release-notes/release-${{ github.ref_name }}.md
|
|
make_latest: true
|
|
draft: true
|
|
prerelease: false
|
|
files: |
|
|
dist/main.js
|
|
dist/manifest.json
|
|
dist/styles.css
|