Skip to content

fix(release): gate AUR on GitHub release - #205

Merged
HsiangNianian merged 3 commits into
mainfrom
fix/aur-release-gate
Aug 4, 2026
Merged

fix(release): gate AUR on GitHub release#205
HsiangNianian merged 3 commits into
mainfrom
fix/aur-release-gate

Conversation

@HsiangNianian

@HsiangNianian HsiangNianian commented Aug 4, 2026

Copy link
Copy Markdown
Member

Summary

  • skip AUR publishing when the current version has no matching GitHub Release
  • keep the AUR job rerunnable once the release exists
  • lock the gate and every dependent step into the release workflow contract

Validation

  • pnpm test:release
  • pnpm test:parity
  • pnpm exec prek run --all-files

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:

  • Add a release-check step to the AUR job and condition all subsequent steps on a matching GitHub release being present.

Tests:

  • Extend release workflow tests to assert the presence of the AUR release gate and that all dependent steps are conditioned on the gate output.

Copilot AI review requested due to automatic review settings August 4, 2026 07:06
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Workspace change through: 16106c5

1 changesets found

Planned changes to release
Package Bump Level Current Version Next Version
@dropout/docs patch 0.1.0-rc.0 0.1.0-rc.1
@dropout/ui patch 0.1.0-rc.0 0.1.0-rc.1
dropout patch 0.2.0-rc.0 0.2.0-rc.1

@sourcery-ai

sourcery-ai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Gates 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 release

flowchart 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]
Loading

File-Level Changes

Change Details Files
Gate the AUR publish workflow steps on a preceding GitHub release existence check.
  • Add a 'Check matching GitHub release' step that derives the version from src-tauri/tauri.conf.json and uses the GitHub CLI to detect a matching release tag
  • Expose a published=true/false flag via GITHUB_OUTPUT based on whether the release exists
  • Add conditional if: steps.release-check.outputs.published == 'true' guards to all subsequent AUR-related steps so they only run when the release has been published
.github/workflows/semifold-ci.yaml
Extend release workflow tests to assert the presence and usage of the release gate in the AUR job.
  • Locate the release-check step in the AUR job and assert it runs gh release view with the expected tag pattern
  • Assert that every AUR job step after the gate has an if condition depending on steps.release-check.outputs.published == 'true'
scripts/release-workflow.test.mjs

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread .github/workflows/semifold-ci.yaml

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 the publish-aur workflow 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.

Copilot AI review requested due to automatic review settings August 4, 2026 07:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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. These if: 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`,
    );

Comment thread .github/workflows/semifold-ci.yaml
Copilot AI review requested due to automatic review settings August 4, 2026 07:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 return 0 when the release gate is the first step; using releaseGateIndex > 0 would 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");

@HsiangNianian
HsiangNianian merged commit 5d21e0b into main Aug 4, 2026
25 of 26 checks passed
@HsiangNianian
HsiangNianian deleted the fix/aur-release-gate branch August 4, 2026 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants