Skip to content

Commit

Permalink
ci: Fix tags on ad hoc unitctl releases
Browse files Browse the repository at this point in the history
- Adds `unitctl/` prefix to tags generated by manual workflow runs.
  Previously, only release titles (but not tags) were prefixed.

- Omits superfluous `name` field; falls back to `tag` when absent.

- Removes unnecessary conditional from `prelease` field.

This results in the following tagging / releasing behavior:

1. Running manually creates a pre-release and tags it `unitctl/VERSION`
2. Pushing a tag formatted like `x.y.z` creates a normal release

Refines: 3501a50
  • Loading branch information
callahad committed Sep 9, 2024
1 parent 27d3a5c commit 5c58f9d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/unitctl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,8 @@ jobs:
uses: ncipollo/release-action@v1
with:
artifacts: "unitctl-*"
# false if triggered by a tag
prerelease: ${{github.event_name == 'workflow_dispatch' && true}}
tag: ${{(github.event_name == 'workflow_dispatch' && inputs.version) || github.ref_name}}
name: unitctl/${{(github.event_name=='workflow_dispatch' && inputs.version) || github.ref_name}}
prerelease: ${{ github.event_name == 'workflow_dispatch' }}
tag: ${{ inputs.version && format('unitctl/{0}', inputs.version) || github.ref_name }}
body: >
## Unitctl
Expand Down

0 comments on commit 5c58f9d

Please sign in to comment.