Files
Discodrome/.github/workflows/release.yml
T
Claude 9ee12f2a31 Automate manifest.json version updates during release
Update `make release` to write the version into manifest.json and commit
it before tagging, so the packaged artifact always carries the correct
version. Also add a CI guard in the release workflow that fails early if
the tag and manifest versions ever diverge.

https://claude.ai/code/session_0158SxS2ATe6PL8zTpsoHRFn
2026-02-07 22:46:44 +00:00

51 lines
1.5 KiB
YAML

name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v5
- name: Verify manifest version matches tag
run: |
TAG_VERSION="${GITHUB_REF_NAME#v}"
MANIFEST_VERSION=$(grep -oP '"version"\s*:\s*"\K[^"]+' manifest.json)
if [ "$TAG_VERSION" != "$MANIFEST_VERSION" ]; then
echo "::error::Tag version ($TAG_VERSION) does not match manifest.json version ($MANIFEST_VERSION)"
exit 1
fi
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Install TinyGo
run: |
wget https://github.com/tinygo-org/tinygo/releases/download/v0.40.1/tinygo_0.40.1_amd64.deb
sudo dpkg -i tinygo_0.40.1_amd64.deb
sudo apt install -y binaryen
- name: Run tests
run: make test
- name: Build and package plugin
run: make package
- name: Create release
uses: softprops/action-gh-release@v2
with:
draft: true
files: discord-rich-presence.ndp
generate_release_notes: true