Skip to content

Add release workflow - #12

Merged
vietle-bh merged 2 commits into
developfrom
AddReleaseWorkflow
Nov 3, 2026
Merged

vietle-bh merged 2 commits into
developfrom
AddReleaseWorkflow

Conversation

@vietle-bh

@vietle-bh vietle-bh commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Issues addressed by this PR

This pull request introduces an automated alpha release workflow for the Python package, along with supporting code and tests. The main changes add an alpha-version command to the py2cs tool, implement the logic for generating and stamping alpha versions, and ensure that alpha releases are only published when appropriate. The PR also updates CI workflows to coordinate access to develop and tags, and adds comprehensive tests for the new functionality.

Alpha release workflow and versioning:

  • Added .github/workflows/alpha-release.yml, a new workflow that publishes pre-release (alpha) builds of the package from the develop branch to TestPyPI, using a version string based on the BHoM version and UTC timestamp. The workflow only publishes if develop has moved since the last alpha, never commits the stamped version, and coordinates with other workflows to avoid conflicts.
  • Updated the concurrency group in .github/workflows/python-schema-generation.yml and .github/workflows/release.yml to develop-publishing, ensuring only one workflow can write to develop or its tags at a time. [1] [2]

Alpha versioning command and implementation:

  • Added the alpha-version command to py2cs, which reads the BHoM version from a package’s _version.py, generates a PEP 440-compliant alpha version string with a UTC timestamp, checks that the version is not already released, and (optionally) stamps the version into the file. [1] [2] [3] [4] [5]

Testing:

  • Added .ci/unit-tests/python/test_py2cs/test_alpha.py with comprehensive tests for alpha version generation, stamping, error handling, and the CLI command.
  • Extended .ci/unit-tests/python/test_py2cs/test_workflows.py with tests to verify the alpha workflow’s behavior, including dry runs, permissions, tagging, and concurrency.

These changes automate and safeguard the process of publishing alpha (pre-release) builds, ensuring correct versioning, workflow coordination, and robust testing.

Test files

Changelog

Additional comments

@vietle-bh vietle-bh self-assigned this Nov 3, 2026
@vietle-bh
vietle-bh merged commit d961828 into develop Nov 3, 2026
2 checks passed
@vietle-bh
vietle-bh deleted the AddReleaseWorkflow branch November 3, 2026 12:00
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.

1 participant