-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Update package publish workflow to v1.6.4 (#31)
* Update pypa/gh-action-pypi-publish from v1.4.2 to v1.6.4. * Add publish to TestPyPI option.
- Loading branch information
1 parent
3c81ccc
commit 5f5c935
Showing
1 changed file
with
21 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -4,14 +4,25 @@ on: | |
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
tags: | ||
- v* | ||
- v* | ||
pull_request: | ||
branches: | ||
- main | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
inputs: | ||
publish: | ||
type: choice | ||
description: 'Publish to TestPyPI?' | ||
options: | ||
- false | ||
- true | ||
|
||
|
||
jobs: | ||
build-and-publish: | ||
|
@@ -54,16 +65,21 @@ jobs: | |
run: python -m zipfile --list dist/adage-*.whl | ||
|
||
- name: Publish distribution 📦 to Test PyPI | ||
# publish to TestPyPI on tag events | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'yadage/adage' | ||
uses: pypa/[email protected] | ||
# Publish to TestPyPI on tag events of if manually triggered | ||
# Compare to 'true' string as booleans get turned into strings in the console | ||
if: >- | ||
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'yadage/adage') | ||
|| (github.event_name == 'workflow_dispatch' && github.event.inputs.publish == 'true' && github.repository == 'yadage/adage') | ||
uses: pypa/[email protected] | ||
with: | ||
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
print_hash: true | ||
|
||
- name: Publish distribution 📦 to PyPI | ||
# publish to PyPI on releases | ||
if: github.event_name == 'release' && github.event.action == 'published' && github.repository == 'yadage/adage' | ||
uses: pypa/gh-action-pypi-publish@v1.4.2 | ||
uses: pypa/gh-action-pypi-publish@v1.6.4 | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
print_hash: true |