From a2c0bc8a1e2848d1493fbc0a4127741a7571c868 Mon Sep 17 00:00:00 2001 From: Andrea Alberti Date: Wed, 25 Feb 2026 15:22:03 +0100 Subject: [PATCH] build: added automated workflow for publishing releases MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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. --- .github/workflows/release.yml | 50 +++++++++++++++++++++++++++++++++++ versions.json | 3 ++- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ddb8d57 --- /dev/null +++ b/.github/workflows/release.yml @@ -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 diff --git a/versions.json b/versions.json index 26382a1..9eb3c9f 100644 --- a/versions.json +++ b/versions.json @@ -1,3 +1,4 @@ { - "1.0.0": "0.15.0" + "1.0.0": "0.15.0", + "1.7.10": "1.5.0" }