fix(release): gate AUR on GitHub release - #205
Conversation
Workspace change through: 16106c51 changesets found Planned changes to release
|
Reviewer's GuideGates the AUR publishing job on the existence of a matching GitHub Release and adds test coverage to enforce this contract for all subsequent AUR job steps. Flow diagram for gating AUR publishing on GitHub releaseflowchart TD
A[AUR job start] --> B[Check matching GitHub release<br/>id: release-check<br/>run: gh release view 'dropout-v$version']
B --> C{steps.release-check.outputs.published == 'true'}
C -->|true| D[Install pnpm]
D --> E[Install Node.js]
E --> F[Install Makepkg]
F --> G[Install Node.js Dependencies]
G --> H[Download Linux build artifacts]
H --> I[Publish AUR package<br/>run: pnpm exec tsx scripts/release-aur.ts]
C -->|false| J[Skip remaining AUR steps]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path=".github/workflows/semifold-ci.yaml" line_range="282-292" />
<code_context>
+ id: release-check
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: |
+ version=$(jq -r '.version' src-tauri/tauri.conf.json)
+ if gh release view "dropout-v$version" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
+ echo "published=true" >> "$GITHUB_OUTPUT"
+ else
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Consider failing fast if `jq` or `gh` themselves error to avoid silently skipping AUR publish on infra issues.
Currently any `jq` or `gh` failure (e.g., malformed/missing `tauri.conf.json`, network/permission issues) just falls into the `else` and sets `published=false`, making infra/config problems indistinguishable from “no matching release” and silently skipping AUR publish.
Please make the step fail when `jq`/`gh` error, for example by using `set -euo pipefail` and `jq -e` (or checking exit codes) so that invalid config or CLI issues stop the workflow instead of being treated as “not published.”
```suggestion
- name: Check matching GitHub release
id: release-check
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
version=$(jq -re '.version' src-tauri/tauri.conf.json)
if output=$(gh release view "dropout-v${version}" --repo "${GITHUB_REPOSITORY}" 2>&1); then
echo "published=true" >> "${GITHUB_OUTPUT}"
else
if echo "${output}" | grep -qi 'not found'; then
echo "published=false" >> "${GITHUB_OUTPUT}"
else
echo "${output}" >&2
exit 1
fi
fi
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Pull request overview
This PR updates the release workflow contract so AUR publishing is skipped unless a matching GitHub Release tag exists for the current src-tauri/tauri.conf.json version, while keeping the AUR job safe to re-run later once the release appears.
Changes:
- Add a “matching GitHub release” gate (
release-check) to thepublish-aurworkflow job and conditionally run all subsequent AUR steps only when the release exists. - Extend the release workflow test to enforce presence of the gate step and require every downstream AUR step to be guarded by
steps.release-check.outputs.published == 'true'.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| scripts/release-workflow.test.mjs | Adds assertions that the AUR job includes a GitHub Release existence gate and that all later steps are conditional on it. |
| .github/workflows/semifold-ci.yaml | Introduces release-check step and gates AUR publish prerequisites + publish step on the release being present. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
Suppressed comments (2)
.github/workflows/semifold-ci.yaml:316
- Same issue as above: remaining steps still use
steps.release-check...even though the step id contains a hyphen. Theseif:expressions should also use bracket notation so the gate actually controls the dependent steps.
- name: Install Node.js Dependencies
if: steps.release-check.outputs.published == 'true'
run: pnpm install --frozen-lockfile
- name: Download Linux build artifacts
if: steps.release-check.outputs.published == 'true'
scripts/release-workflow.test.mjs:71
- The workflow should gate on
steps['release-check'].outputs.published(bracket notation) because the step id contains a hyphen. The test currently asserts the invalid dot-notation expression, which would encode the bug into the workflow contract.
for (const step of aurJob.steps.slice(releaseGateIndex + 1)) {
assert.equal(
step.if,
"steps.release-check.outputs.published == 'true'",
`${step.name} must wait for a matching GitHub release`,
);
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (1)
scripts/release-workflow.test.mjs:53
findIndex()can validly return0when the release gate is the first step; usingreleaseGateIndex > 0would incorrectly report the gate as missing. If the intent is only to assert the gate exists, this should be>= 0(and add a separate assertion if you specifically need it to come after checkout).
const releaseGateIndex = aurJob.steps.findIndex(
({ id }) => id === "release_check",
);
assert.ok(releaseGateIndex > 0, "AUR release gate is missing");
Summary
Validation
Summary by Sourcery
Gate AUR publishing in the release workflow on the existence of a matching GitHub release and keep the job rerunnable once the release is created.
CI:
Tests: