Skip to content

Create separate GitHub Action for generating point releases#571

Open
gridhead wants to merge 1 commit into
mainfrom
tags
Open

Create separate GitHub Action for generating point releases#571
gridhead wants to merge 1 commit into
mainfrom
tags

Conversation

@gridhead

@gridhead gridhead commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Create separate GitHub Action for generating point releases

Fixes #546

Summary by Sourcery

Introduce a dedicated release workflow that reuses the existing platform build jobs and automates tagged point releases.

Build:

  • Allow the GNU/Linux and Windows build workflows to be triggered via workflow_call with an explicit build identifier instead of only scheduled runs.
  • Adjust artifact naming, version suffixing, and overwrite behavior in build workflows to support both nightly and release builds.
  • Add a new release workflow that, on semantic-version tags, builds binaries and Python packages, creates a draft GitHub release with attached artifacts, and publishes packages to PyPI.

@gridhead gridhead added this to the Luna VII milestone Jun 24, 2026
@gridhead gridhead requested a review from sdglitched June 24, 2026 15:17
@gridhead gridhead self-assigned this Jun 24, 2026
@gridhead gridhead added the enhancement New feature or request label Jun 24, 2026
@sourcery-ai

sourcery-ai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds a new tag-triggered release workflow that reuses the existing Linux and Windows build workflows via workflow_call inputs, and generalizes those build workflows to support both nightly scheduled builds and tagged point releases with appropriate version identifiers and artifact overwrite behavior.

File-Level Changes

Change Details Files
Generalize Windows build workflow to support both scheduled nightly builds and reusable builds with an injected identifier.
  • Rename workflow to remove "nightly" wording to reflect broader usage.
  • Add workflow_call trigger with a required string input used as a build identifier when invoked as a reusable workflow.
  • Replace the fixed git SHA-based identifier step with logic that uses the SHA for scheduled runs and the provided input identifier otherwise.
  • Gate the pyproject.toml version-mangling step so it only runs for scheduled nightly builds, avoiding version rewriting for tagged releases.
  • Update output filenames to use the new identifier step outputs and make artifact overwrite conditional on being a scheduled run.
.github/workflows/mswn.yml
Generalize Linux build workflow similarly to support both nightly and tagged release builds with a flexible identifier and conditional versioning/overwrite.
  • Rename workflow to remove "nightly" wording.
  • Add workflow_call trigger with a required string identifier input for reusable invocations.
  • Change the identifier step to choose between git SHA for schedules and the provided input for other callers.
  • Make the pyproject.toml version update step conditional on scheduled runs only, and use the new identifier output.
  • Switch PyInstaller output name to use the identifier output and make artifact overwrite conditional on scheduled runs.
.github/workflows/gnul.yml
Introduce a dedicated point-release workflow that builds platform binaries and PyPI artifacts on tag pushes, then drafts a GitHub release and publishes to PyPI.
  • Add rlse.yml workflow triggered on semantic-version-like tag pushes ("..*").
  • Reuse gnul.yml and mswn.yml via workflow_call, passing the tag name as the identifier so artifacts are tag-labeled.
  • Add a PyPI build job that builds sdist and wheel and uploads them as artifacts.
  • Add a release job that downloads all artifacts, creates a draft GitHub release using gh release create with generated notes, and then publishes the PyPI distributions using pypa/gh-action-pypi-publish.
.github/workflows/rlse.yml

Assessment against linked issues

Issue Objective Addressed Explanation
#546 Create a separate GitHub Actions workflow that runs on new version tags being pushed and generates point-release build artifacts.
#546 Automatically create a draft GitHub Release for the new tag with the built artifacts attached.
#546 Create and publish an associated PyPI release as part of the point-release workflow.

Possibly linked issues


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

@gemini-code-assist

Copy link
Copy Markdown

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 3 issues, and left some high level feedback:

  • Consider enforcing or validating that the tag name (used as identifier) is in a normalized format (e.g., stripping a leading v or disallowing other characters) before using it in artifact filenames so you don’t end up with unexpected or inconsistent binary names.
  • In the release workflow, you might want to add a check that the pyproject.toml version matches the semantic tag being built, and fail early if they diverge, to avoid publishing artifacts whose internal version doesn’t match the release tag.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider enforcing or validating that the tag name (used as `identifier`) is in a normalized format (e.g., stripping a leading `v` or disallowing other characters) before using it in artifact filenames so you don’t end up with unexpected or inconsistent binary names.
- In the release workflow, you might want to add a check that the `pyproject.toml` version matches the semantic tag being built, and fail early if they diverge, to avoid publishing artifacts whose internal version doesn’t match the release tag.

## Individual Comments

### Comment 1
<location path=".github/workflows/mswn.yml" line_range="67" />
<code_context>
           retention-days: 2
           compression-level: 9
-          overwrite: true
+          overwrite: ${{ github.event_name == 'schedule' }}
</code_context>
<issue_to_address>
**issue (bug_risk):** Conditionally disabling artifact overwrites may cause reruns of non-scheduled runs to fail

Tying `overwrite` to `github.event_name == 'schedule'` means `workflow_call` runs (e.g., release for an existing tag) will re-upload an artifact name that already exists with `overwrite: false`, causing `actions/upload-artifact` to fail the job. If reruns for the same tag are expected, keep `overwrite: true` for all events or base the condition on a more stable identifier (e.g., a unique run attempt) instead of the event type.
</issue_to_address>

### Comment 2
<location path=".github/workflows/gnul.yml" line_range="66" />
<code_context>
           retention-days: 2
           compression-level: 9
-          overwrite: true
+          overwrite: ${{ github.event_name == 'schedule' }}
</code_context>
<issue_to_address>
**issue (bug_risk):** Same overwrite condition issue for GNU/Linux artifacts as for Windows

Here we’ll hit the same rerun issue as in the Windows workflow: for release runs triggered via `workflow_call` (e.g. `rlse.yml`), re-running a workflow for the same tag will try to upload `gi-loadouts.gnul` with `overwrite: false`, causing the upload to fail. Please adjust the condition so release reruns can safely overwrite artifacts, and keep the behavior consistent between the workflows.
</issue_to_address>

### Comment 3
<location path=".github/workflows/rlse.yml" line_range="44-49" />
<code_context>
+      - name: Build the source distribution and wheel
+        run: python -m build
+
+      - name: Upload the distribution packages to the GitHub Artifacts
+        uses: actions/upload-artifact@v7
+        with:
+          name: gi-loadouts.pypi
+          path: dist/*
+          compression-level: 9
+
+  ci-rlse:
</code_context>
<issue_to_address>
**suggestion:** PyPI artifact uploads may fail on reruns because overwrite is not enabled

Because this artifact name is constant and `actions/upload-artifact` defaults to `overwrite: false`, reruns for the same tag may fail when the artifact already exists. To align with the binary workflows and keep reruns reliable, set `overwrite: true` on this step.

```suggestion
      - name: Upload the distribution packages to the GitHub Artifacts
        uses: actions/upload-artifact@v7
        with:
          name: gi-loadouts.pypi
          path: dist/*
          compression-level: 9
          overwrite: true
```
</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.

retention-days: 2
compression-level: 9
overwrite: true
overwrite: ${{ github.event_name == 'schedule' }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue (bug_risk): Conditionally disabling artifact overwrites may cause reruns of non-scheduled runs to fail

Tying overwrite to github.event_name == 'schedule' means workflow_call runs (e.g., release for an existing tag) will re-upload an artifact name that already exists with overwrite: false, causing actions/upload-artifact to fail the job. If reruns for the same tag are expected, keep overwrite: true for all events or base the condition on a more stable identifier (e.g., a unique run attempt) instead of the event type.

retention-days: 2
compression-level: 9
overwrite: true
overwrite: ${{ github.event_name == 'schedule' }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue (bug_risk): Same overwrite condition issue for GNU/Linux artifacts as for Windows

Here we’ll hit the same rerun issue as in the Windows workflow: for release runs triggered via workflow_call (e.g. rlse.yml), re-running a workflow for the same tag will try to upload gi-loadouts.gnul with overwrite: false, causing the upload to fail. Please adjust the condition so release reruns can safely overwrite artifacts, and keep the behavior consistent between the workflows.

Comment on lines +44 to +49
- name: Upload the distribution packages to the GitHub Artifacts
uses: actions/upload-artifact@v7
with:
name: gi-loadouts.pypi
path: dist/*
compression-level: 9

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion: PyPI artifact uploads may fail on reruns because overwrite is not enabled

Because this artifact name is constant and actions/upload-artifact defaults to overwrite: false, reruns for the same tag may fail when the artifact already exists. To align with the binary workflows and keep reruns reliable, set overwrite: true on this step.

Suggested change
- name: Upload the distribution packages to the GitHub Artifacts
uses: actions/upload-artifact@v7
with:
name: gi-loadouts.pypi
path: dist/*
compression-level: 9
- name: Upload the distribution packages to the GitHub Artifacts
uses: actions/upload-artifact@v7
with:
name: gi-loadouts.pypi
path: dist/*
compression-level: 9
overwrite: true

Signed-off-by: Akashdeep Dhar <akashdeep.dhar@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create separate GitHub Action for generating point releases

1 participant