Skip to content

Commit e6b7163

Browse files
committed
Update deploy workflow to normalize version
1 parent bd67d48 commit e6b7163

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

.github/workflows/deploy.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
python-version: 3.11
1818
- name: Install dependencies
1919
run: |
20-
python -m pip install --upgrade pip setuptools wheel build
20+
python -m pip install --upgrade pip setuptools wheel build semver
2121
- name: Build
2222
run: |
2323
python -m build
@@ -27,19 +27,22 @@ jobs:
2727
with:
2828
user: __token__
2929
password: ${{ secrets.PYPI_PASSWORD }}
30+
- name: Normalize Version
31+
id: normalize
32+
run: echo "version=$(python -c 'import semver; print(semver.Version.parse("${{ github.ref_name }}", optional_minor_and_patch=True))')" >> $GITHUB_OUTPUT
3033
- name: Get Changelog Entry
3134
if: success()
3235
id: changelog_reader
3336
uses: mindsers/changelog-reader-action@v2
3437
with:
35-
version: ${{ github.ref_name }}
38+
version: ${{ steps.normalize.outputs.version }}
3639
path: ./docs/changelog.md
3740
- name: Release to GitHub
3841
if: success()
3942
uses: ncipollo/release-action@v1
4043
with:
41-
tag: ${{ steps.changelog_reader.outputs.version }}
42-
name: Release ${{ steps.changelog_reader.outputs.version }}
44+
tag: ${{ github.ref_name }}
45+
name: Release ${{ github.ref_name }}
4346
body: ${{ steps.changelog_reader.outputs.changes }}
4447
artifacts: dist/**
4548
prerelease: ${{ steps.changelog_reader.outputs.status == 'prereleased' }}

0 commit comments

Comments
 (0)