From 0326fc740fb1531801c84f7c78e460016931f958 Mon Sep 17 00:00:00 2001 From: Jon Langevin Date: Sun, 24 May 2026 17:24:31 -0400 Subject: [PATCH] =?UTF-8?q?chore:=20post-release=20cleanup=20v0.1.2=20?= =?UTF-8?q?=E2=80=94=20getReleaseByTag=20fix,=20version=20bump,=20drop=20s?= =?UTF-8?q?ync=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix getReleaseByTag → listReleases+filter (avoids 404 on GoReleaser draft); bump plugin.json to 0.1.2 + update download URLs; remove sync-plugin-version.yml (superseded by goreleaser before-hook). Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/release.yml | 8 ++- .github/workflows/sync-plugin-version.yml | 59 ----------------------- plugin.json | 10 ++-- 3 files changed, 12 insertions(+), 65 deletions(-) delete mode 100644 .github/workflows/sync-plugin-version.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d9ec728..fbb4510 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -82,7 +82,13 @@ jobs: script: | const tag = context.ref.replace('refs/tags/', ''); const { owner, repo } = context.repo; - const { data: release } = await github.rest.repos.getReleaseByTag({ owner, repo, tag }); + // listReleases returns drafts; getReleaseByTag 404s on drafts. GoReleaser + // creates releases as draft; this step flips them to non-draft post-publish. + const { data: releases } = await github.rest.repos.listReleases({ owner, repo, per_page: 100 }); + const release = releases.find(r => r.tag_name === tag); + if (!release) { + throw new Error(`release for tag ${tag} not found in repo listing (latest 100 releases)`); + } if (release.draft) { await github.rest.repos.updateRelease({ owner, diff --git a/.github/workflows/sync-plugin-version.yml b/.github/workflows/sync-plugin-version.yml deleted file mode 100644 index f74f8a9..0000000 --- a/.github/workflows/sync-plugin-version.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: Sync plugin.json version -on: - push: - tags: ['v*'] -permissions: - contents: write - pull-requests: write -jobs: - sync: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - ref: main - fetch-depth: 0 - token: ${{ secrets.GITHUB_TOKEN }} - - name: Compute target version from tag - id: ver - run: | - TAG="${GITHUB_REF_NAME}" - VERSION="${TAG#v}" - echo "version=$VERSION" >> $GITHUB_OUTPUT - echo "tag=$TAG" >> $GITHUB_OUTPUT - - name: Update plugin.json - run: | - if [ ! -f plugin.json ]; then echo "no plugin.json; skipping"; exit 0; fi - CURRENT=$(python3 -c "import json; print(json.load(open('plugin.json')).get('version',''))") - TARGET="${{ steps.ver.outputs.version }}" - if [ "$CURRENT" = "$TARGET" ]; then - echo "plugin.json already at $TARGET; no action" - exit 0 - fi - python3 -c " - import json - p = json.load(open('plugin.json')) - p['version'] = '$TARGET' - json.dump(p, open('plugin.json', 'w'), indent=2) - open('plugin.json', 'a').write('\n') - " - - name: Open sync PR if plugin.json changed - run: | - if git diff --quiet plugin.json; then - echo "no changes" - exit 0 - fi - BRANCH="chore/sync-plugin-version-${{ steps.ver.outputs.tag }}" - git config user.email "github-actions[bot]@users.noreply.github.com" - git config user.name "github-actions[bot]" - git checkout -b "$BRANCH" - git add plugin.json - git commit -m "chore: sync plugin.json version to ${{ steps.ver.outputs.tag }}" - git push origin "$BRANCH" - gh pr create \ - --base main \ - --head "$BRANCH" \ - --title "chore: sync plugin.json version to ${{ steps.ver.outputs.tag }}" \ - --body "Triggered by release ${{ steps.ver.outputs.tag }}. Auto-sync to prevent drift. Closes workflow-registry#37." - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/plugin.json b/plugin.json index b604144..cab1b68 100644 --- a/plugin.json +++ b/plugin.json @@ -1,6 +1,6 @@ { "name": "discord", - "version": "0.1.1", + "version": "0.1.2", "author": "GoCodeAlone", "description": "Discord messaging, bots, and voice", "type": "external", @@ -135,22 +135,22 @@ { "os": "linux", "arch": "amd64", - "url": "https://github.com/GoCodeAlone/workflow-plugin-discord/releases/download/v0.1.1/workflow-plugin-discord-linux-amd64.tar.gz" + "url": "https://github.com/GoCodeAlone/workflow-plugin-discord/releases/download/v0.1.2/workflow-plugin-discord-linux-amd64.tar.gz" }, { "os": "linux", "arch": "arm64", - "url": "https://github.com/GoCodeAlone/workflow-plugin-discord/releases/download/v0.1.1/workflow-plugin-discord-linux-arm64.tar.gz" + "url": "https://github.com/GoCodeAlone/workflow-plugin-discord/releases/download/v0.1.2/workflow-plugin-discord-linux-arm64.tar.gz" }, { "os": "darwin", "arch": "amd64", - "url": "https://github.com/GoCodeAlone/workflow-plugin-discord/releases/download/v0.1.1/workflow-plugin-discord-darwin-amd64.tar.gz" + "url": "https://github.com/GoCodeAlone/workflow-plugin-discord/releases/download/v0.1.2/workflow-plugin-discord-darwin-amd64.tar.gz" }, { "os": "darwin", "arch": "arm64", - "url": "https://github.com/GoCodeAlone/workflow-plugin-discord/releases/download/v0.1.1/workflow-plugin-discord-darwin-arm64.tar.gz" + "url": "https://github.com/GoCodeAlone/workflow-plugin-discord/releases/download/v0.1.2/workflow-plugin-discord-darwin-arm64.tar.gz" } ] }