Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/validate-addon.yml
Original file line number Diff line number Diff line change
@@ -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

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
36 changes: 36 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -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 <branch>`
- `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
```

Loading