From ce31ff0703b9daf488437a74a8753edf0810a83c Mon Sep 17 00:00:00 2001 From: mathijs-bakker Date: Thu, 16 Apr 2026 09:16:47 +0200 Subject: [PATCH] add release docs and addon validation workflow --- .github/workflows/validate-addon.yml | 43 ++++++++++++++++++++++++++++ README.md | 4 +++ RELEASING.md | 36 +++++++++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 .github/workflows/validate-addon.yml create mode 100644 RELEASING.md diff --git a/.github/workflows/validate-addon.yml b/.github/workflows/validate-addon.yml new file mode 100644 index 0000000..cd17ed7 --- /dev/null +++ b/.github/workflows/validate-addon.yml @@ -0,0 +1,43 @@ +name: Validate Addon + +on: + pull_request: + push: + branches: + - "**" + +jobs: + validate-addon: + runs-on: ubuntu-latest + + steps: + - name: Check out source + uses: actions/checkout@v4 + + - name: Validate plugin.cfg semver + run: | + version="$(sed -n 's/^version="\(.*\)"$/\1/p' addons/godotdev_nvim_node_copy/plugin.cfg)" + if [ -z "$version" ]; then + echo "Could not read version from plugin.cfg" >&2 + exit 1 + fi + + case "$version" in + [0-9]*.[0-9]*.[0-9]*) + ;; + *) + echo "plugin.cfg version '$version' is not valid semver" >&2 + exit 1 + ;; + esac + + - name: Build release payload layout + run: | + mkdir -p dist/addons + cp -R addons/godotdev_nvim_node_copy dist/addons/ + test -f dist/addons/godotdev_nvim_node_copy/plugin.cfg + test -f dist/addons/godotdev_nvim_node_copy/plugin.gd + test -f dist/addons/godotdev_nvim_node_copy/README.md + cd dist + zip -r addon.zip addons + diff --git a/README.md b/README.md index 4022811..7d81832 100644 --- a/README.md +++ b/README.md @@ -210,3 +210,7 @@ To use `neovim_remote` mode: - Support `%UniqueNode` when appropriate - Add C# snippet variants - Let users choose snippet style in plugin settings + +## Releasing + +Release steps are documented in [RELEASING.md](RELEASING.md). diff --git a/RELEASING.md b/RELEASING.md new file mode 100644 index 0000000..c611ecf --- /dev/null +++ b/RELEASING.md @@ -0,0 +1,36 @@ +# Releasing + +This repository uses the version in `addons/godotdev_nvim_node_copy/plugin.cfg` +as the release version that Godot users will see after installing from GitHub or +the Asset Library. + +## Release flow + +1. Make sure your working tree is clean. +2. Run `./scripts/prepare-release.sh 0.3.1` or `./scripts/prepare-release.sh 0.3.1 --push`. +3. If you did not use `--push`, push the branch and the tag: + - `git push origin ` + - `git push origin v0.3.1` +4. Wait for GitHub Actions to run `Package Release`. +5. Verify the GitHub release contains `godotdev_nvim_node_copy-0.3.1.zip`. + +## What the script does + +- updates `plugin.cfg` +- creates a release commit +- creates a `vX.Y.Z` tag +- optionally pushes the branch and tag + +## Safety checks + +- `scripts/prepare-release.sh` refuses to run with a dirty working tree. +- `Package Release` fails if `plugin.cfg` does not match the tag version. +- `Validate Addon` checks semver formatting and the packaged addon layout on push + and pull request. + +## Example + +```bash +./scripts/prepare-release.sh 0.3.1 --push +``` +