Skip to content

Commit

Permalink
Do release workflow on tagged commit
Browse files Browse the repository at this point in the history
- make release process atomic
  - github release is automatically made after successful build & PyPI upload
  - if the build fails then no release is made
- allows new releases to be made from the command line
  • Loading branch information
lkeegan committed Jun 3, 2024
1 parent 782ab31 commit ff3b408
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Build + Release Wheels

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:
inputs:
use_qemu:
Expand Down Expand Up @@ -161,6 +165,7 @@ jobs:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
if: github.repository_owner == 'ssciwr'

steps:
Expand All @@ -179,3 +184,7 @@ jobs:
if: github.event.inputs.deploy_to_testpypi == 'true'
with:
repository-url: https://test.pypi.org/legacy/

- name: GitHub release for tagged commits
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ In order to add a new release, the following steps are necessary:

* Edit the [version file](https://github.com/ssciwr/clang-format-wheel/blob/main/clang-format_version.txt)
* In the form `llvm_version.wheel_version`, e.g. `18.0.2.1`
* Make a GitHub release to trigger the [GitHub Actions release workflow](https://github.com/ssciwr/clang-format-wheel/actions/workflows/release.yml). Alternatively, the workflow can be triggered manually.
* Tag the commit with this version number to trigger the [GitHub Actions release workflow](https://github.com/ssciwr/clang-format-wheel/actions/workflows/release.yml).
* e.g. `git tag 18.0.2.1 && git push origin 18.0.2.1`

Alternatively, the workflow can be triggered manually:

On manual triggers, the following input variables are available:
* `use_qemu`: Whether to build targets that require emulation (default: `true`)
Expand Down

0 comments on commit ff3b408

Please sign in to comment.