Skip to content

Update deploy workflow to normalize version #1523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel build
python -m pip install --upgrade pip setuptools wheel build semver
- name: Build
run: |
python -m build
Expand All @@ -27,19 +27,22 @@ jobs:
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
- name: Normalize Version
id: normalize
run: echo "version=$(python -c 'import semver; print(semver.Version.parse("${{ github.ref_name }}", optional_minor_and_patch=True))')" >> $GITHUB_OUTPUT
- name: Get Changelog Entry
if: success()
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
version: ${{ github.ref_name }}
version: ${{ steps.normalize.outputs.version }}
path: ./docs/changelog.md
- name: Release to GitHub
if: success()
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.changelog_reader.outputs.version }}
name: Release ${{ steps.changelog_reader.outputs.version }}
tag: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
body: ${{ steps.changelog_reader.outputs.changes }}
artifacts: dist/**
prerelease: ${{ steps.changelog_reader.outputs.status == 'prereleased' }}
Expand Down