build: added automated workflow for publishing releases

- 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.
This commit is contained in:
Andrea Alberti 2026-02-25 15:22:03 +01:00
parent 83e84bfa15
commit a2c0bc8a1e
No known key found for this signature in database
2 changed files with 52 additions and 1 deletions

50
.github/workflows/release.yml vendored Normal file
View file

@ -0,0 +1,50 @@
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

View file

@ -1,3 +1,4 @@
{
"1.0.0": "0.15.0"
"1.0.0": "0.15.0",
"1.7.10": "1.5.0"
}