Record Workshop versions in Drone changelogs and retire local sending

This commit is contained in:
2026-10-17 17:42:39 +02:00
parent 8f2e1f210d
commit 38fd8f7dd2
10 changed files with 222 additions and 96 deletions
+29 -4
View File
@@ -1,9 +1,14 @@
# Discord changelogs through Drone
Active since 2026-10-17: [build #1](https://ci.internet-master.cz/escapists/EscapistsReintroduced/1)
confirmed delivery, and the user confirmed receipt. Drone is the sole sender.
The retired local `tools/discord_changelog.py` exits without sending, including
when invoked with its old arguments.
`.drone.yml` runs a Docker pipeline for pushes to `main`. It tests the notifier,
then reads `CHANGELOG.md` from the pushed commit. Discord receives only the newest
entry's heading and body, with mentions disabled and no build, Git or hosting
status added.
entry's heading and body, plus the last recorded published Workshop version when
available, with mentions disabled and no build, Git or hosting status added.
## One-time setup
@@ -15,8 +20,8 @@ status added.
3. Push these files to `main`, then verify the `notify-discord` step and its
corresponding Discord message. Creating the YAML alone does not activate Drone
or install its Gitea webhook.
4. Once Drone delivery is enabled, stop the manual post-push notifier. Both
delivery paths running for the same push would produce duplicate messages.
4. Keep local/manual notification sending disabled. Do not add a second sender
or automatically fall back to local delivery after a failed Drone build.
Drone's repository activation manages the Gitea event webhook. This notification
pipeline does not compile, publish or update the mission.
@@ -39,6 +44,24 @@ headings inside code examples within an entry. Keep the formatted newest entry
within Discord's 2000-character limit; oversized entries fail without truncation.
The dated files in `publishing/` remain separate Workshop release notes.
After compiling/bundling and successfully publishing in Workbench, run:
```sh
python3 tools/workshop_changelog.py --published
```
The helper reads `asset.version` from Workbench's local publishing manifest and
updates `Latest published Workshop version: **0.0.109**` above the changelog
entries. It verifies the addon ID against `addons/core/addon.gproj`. Use
`--manifest /path/to/manifest.json` on another installation. Without `--published`
it only displays the bundle version. The flag confirms that you observed a
successful upload; the helper does not upload or query the Workshop.
Commit that record together with the new player-facing entry and source changes,
then push. Drone reads the version from Git, without needing Workbench files.
Updating only the version does not resend the previous entry. The message labels
it as the last published version, since a Git push can contain newer changes.
The notifier compares `DRONE_COMMIT_BEFORE` with `DRONE_COMMIT_SHA`, covering the
whole push, even when a documentation commit follows the changelog commit.
Unchanged newest entries, historical edits and removing an entry to expose an
@@ -53,6 +76,8 @@ previous revision; an exact-SHA fetch is attempted for a missing before commit.
## Verification and delivery failures
Run `python3 -m unittest discover -s tests -p test_discord_changelog_ci.py` locally.
Also run `python3 -m unittest discover -s tests -p test_workshop_changelog.py`
for the Workbench version sync.
The tests use temporary Git repositories and mocked HTTP; they send no messages.
`python3 tools/discord_changelog_ci.py --dry-run` inside a Drone checkout with its
normal commit environment prints the selected message without using the secret.