also looking at this
fix(release): stop shipping the wrong binaries, and delete the dead notifier
#43
2 files
+24
-28
| @@ -66,7 +66,11 @@ jobs: | ||
| 66 | 66 | mkdir -p zig-out/cross/darwin-x64 && cp zig-out/bin/craft zig-out/cross/darwin-x64/craft |
| 67 | 67 | echo "::endgroup::" |
| 68 | 68 | |
| 69 | # Restore native ARM64 binary | |
| 69 | # Restore native ARM64 binary. `zig-out/bin` is cleared first because | |
| 70 | # the publish step zips that directory whole and unfiltered, so | |
| 71 | # anything a cross build left in it ships to users under the host's | |
| 72 | # archive name. | |
| 73 | rm -rf zig-out/bin | |
| 70 | 74 | eval "$(pantry env | sed -n '/^export /,$p')" && zig build -Doptimize=ReleaseSafe -Dversion="$VERSION" |
| 71 | 75 | |
| 72 | 76 | - name: First-party Zig dependencies |
| @@ -93,7 +97,12 @@ jobs: | ||
| 93 | 97 | echo "::endgroup::" |
| 94 | 98 | done |
| 95 | 99 | |
| 96 | # Restore native linux-x64 binary | |
| 100 | # Restore native linux-x64 binary. Clearing `zig-out/bin` first is | |
| 101 | # load-bearing: the windows cross build above leaves craft.exe there, | |
| 102 | # nothing removes it, and the publish step zips the whole directory — | |
| 103 | # so craft-linux-x64.zip shipped a Windows PE binary alongside the | |
| 104 | # Linux one. | |
| 105 | rm -rf zig-out/bin | |
| 97 | 106 | eval "$(pantry env | sed -n '/^export /,$p')" && zig build -Doptimize=ReleaseSafe -Dversion="$VERSION" |
| 98 | 107 | |
| 99 | 108 | # ── macOS Code Signing & Notarization ────────────────────────── |
| @@ -199,6 +208,13 @@ jobs: | ||
| 199 | 208 | release: 'true' |
| 200 | 209 | release-changelog: CHANGELOG.md |
| 201 | 210 | release-token: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }} |
| 211 | # Replaces the old `notify` job, which pointed at | |
| 212 | # .github/actions/discord-notify — a path that has never existed in | |
| 213 | # this repository. Its `hashFiles` guard skipped the only real step, | |
| 214 | # so the job checked out the repo, did nothing and reported success: | |
| 215 | # a failed release looked notified. The action does this natively. | |
| 216 | discord-webhook: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
| 217 | notification-title: craft ${{ github.ref_name }} | |
| 202 | 218 | env: |
| 203 | 219 | GITHUB_TOKEN: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }} |
| 204 | 220 | |
| @@ -224,27 +240,3 @@ jobs: | ||
| 224 | 240 | run: pantry publish --npm --access public |
| 225 | 241 | env: |
| 226 | 242 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 227 | ||
| 228 | notify: | |
| 229 | name: discord-notification | |
| 230 | needs: [pantry, npm] | |
| 231 | if: always() | |
| 232 | runs-on: ubuntu-latest | |
| 233 | steps: | |
| 234 | - uses: actions/checkout@v6 | |
| 235 | - uses: ./.github/actions/discord-notify | |
| 236 | if: hashFiles('.github/actions/discord-notify/action.yml') != '' | |
| 237 | with: | |
| 238 | title: "Release $ — $" | |
| 239 | description: "craft $ has been released" | |
| 240 | status: ${{ needs.pantry.result == 'success' && needs.npm.result == 'success' && 'success' || (needs.pantry.result == 'cancelled' || needs.npm.result == 'cancelled') && 'warning' || 'failure' }} | |
| 241 | fields: | | |
| 242 | [ | |
| 243 | {"name": "Tag", "value": "`$`", "inline": true}, | |
| 244 | {"name": "Actor", "value": "$", "inline": true}, | |
| 245 | {"name": "Binaries", "value": "$", "inline": true}, | |
| 246 | {"name": "npm Packages", "value": "$", "inline": true}, | |
| 247 | {"name": "Release", "value": "[View on GitHub](https://github.com/$/releases/tag/$)", "inline": true} | |
| 248 | ] | |
| 249 | webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
| 250 | continue-on-error: true | |