-
Notifications
You must be signed in to change notification settings - Fork 28
Update PyPI publish workflow for prereleases #494
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
+5
−4
Merged
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
cd7b9d3
Update PyPI publish workflow for prereleases
matentzn c0fbfb1
Add development snapshot feature to CHANGELOG.md
matentzn 1a2dbaa
Fix typo in CHANGELOG.md
matentzn 8078221
Remove pre-release version setting step from workflow
matentzn 164ca2d
Merge branch 'add-pypi-prerelease' of https://github.com/mapping-comm…
matentzn b75003e
Update build step name in PyPI workflow
matentzn 856c721
Update PyPI publish workflow comments and formatting
matentzn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,8 +3,8 @@ name: Publish Python Package | |
|
|
||
| on: | ||
| release: | ||
| # Trigger the workflow only for real releases but not for draft releases | ||
| types: [created] | ||
| # Run when a release is published or a prerelease is published (not on draft creation) | ||
| types: [published, prereleased] | ||
|
|
||
| jobs: | ||
| build: | ||
|
|
@@ -26,9 +26,20 @@ jobs: | |
| pipx install poetry | ||
| pipx inject poetry poetry-dynamic-versioning | ||
|
|
||
| - name: Build source and wheel archives | ||
| - name: Set version for pre-release (PEP 440 compliant) | ||
| if: github.event.release.prerelease == true | ||
| shell: bash | ||
| run: | | ||
| poetry build | ||
| BASE_VERSION="$(poetry version -s | sed 's/+.*//')" # strip any local part | ||
| DATE="$(date -u +%Y%m%d)" | ||
| RUN="${{ github.run_number }}" | ||
| SHA="$(git rev-parse --short HEAD)" | ||
| PRERELEASE_VERSION="${BASE_VERSION}.dev${DATE}${RUN}+g${SHA}" | ||
matentzn marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| echo "Setting version to ${PRERELEASE_VERSION}" | ||
| poetry version "${PRERELEASE_VERSION}" | ||
matentzn marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - name: Build sdist & wheel | ||
| run: poetry build | ||
|
|
||
| - name: Store built distribution | ||
| uses: actions/[email protected] | ||
|
|
@@ -45,7 +56,7 @@ jobs: | |
| name: pypi-release | ||
| url: https://pypi.org/p/sssom-schema | ||
| permissions: | ||
| id-token: write # This permission is mandatory for trusted publishing. | ||
| id-token: write # required for OIDC trusted publishing | ||
| steps: | ||
| - name: Download built distribution | ||
| uses: actions/[email protected] | ||
|
|
@@ -54,7 +65,7 @@ jobs: | |
| path: dist | ||
|
|
||
| - name: Publish package 📦 to PyPI | ||
| if: github.event_name == 'release' | ||
| uses: pypa/[email protected] | ||
| with: | ||
| verbose: true | ||
| verbose: true | ||
| skip-existing: true | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.