Skip to content

Commit

Permalink
fix release name from tag in release-drafter setup (#20)
Browse files Browse the repository at this point in the history
I can't really tell if this will work, but I'm going to commit it anyway.
  • Loading branch information
dgarnier authored Sep 23, 2024
1 parent 741fa77 commit a57aac2
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
environment: pypi
permissions:
id-token: write
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
if: github.ref_type == 'tag' && startsWith(github.ref_name, 'v')
steps:
- uses: actions/download-artifact@v4
with:
Expand All @@ -62,20 +62,24 @@ jobs:

- uses: pypa/gh-action-pypi-publish@release/v1

- name: version
id: version
- name: Get version
id: get_version
run: |
tag=${GITHUB_REF/refs\/tags\//}
version=${tag#v}
major=${version%%.*}
echo "tag=${tag}" >> $GITHUB_OUTPUT
echo "version=${version}" >> $GITHUB_OUTPUT
echo "major=${major}" >> $GITHUB_OUTPUT
echo "version=${{ github.ref_name }}" >> $GITHUB_OUTPUT
if [[ ${{ contains(github.ref_name, '-beta.rc') }} == 'true' ]]; then
echo "prerelease=true" >> $GITHUB_OUTPUT
else
echo "prerelease=false" >> $GITHUB_OUTPUT
fi
- uses: release-drafter/release-drafter@v6
- name: Create Release and Changelog
id: create-release
uses: release-drafter/release-drafter@v6
with:
version: ${{ steps.version.outputs.version }}
publish: true
tag: ${{ steps.get_version.outputs.version }}
version: ${{ steps.get_version.outputs.version }}
prerelease: ${{ steps.get_version.outputs.prerelease }}
publish: true # ensures release is not marked as draft
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down

0 comments on commit a57aac2

Please sign in to comment.