Skip to content

Commit 37ec234

Browse files
committed
publish/action.yaml: Dev version of v2 of the publish action.
Breaking change from v1: - The `pypi` input has been replaced with a `test-only` input. - The action now publishes to both test.pypi.org and pypi.org depending on the value of the `test-only` input - publishes only to test.pypi.org unless `test-only` is not set to `true`.
1 parent 2091722 commit 37ec234

File tree

1 file changed

+17
-22
lines changed

1 file changed

+17
-22
lines changed

publish/action.yaml

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
name: Publish python package
22
description: |-
3-
A github action to publish a python package to pypi.org or test.pypi.org.
3+
A github action to publish a python package to test.pypi.org and pypi.org.
44
Input options:
5-
- `pypi: test.pypi` or `pypi: upload.pypi`: Publish to test.pypi or pypi.org.
6-
Invoke with `uses: glenn20/python-ci/publish@v1`
5+
- `test-only`: Publish only to test.pypi.org if set to `true` (default).
6+
Invoke with `uses: glenn20/python-ci/publish@v2`
77
author: glenn20
8+
89
inputs:
9-
pypi:
10-
description: 'Set to "upload.pypi" or "test.pypi" (default).'
11-
default: 'test.pypi'
10+
test-only:
11+
description: 'Publish only to test.pypi if `true` (default).'
12+
default: 'true'
1213
required: false
13-
type: string
14-
# secrets:
15-
# pypi_token:
16-
# description: 'PyPI API token'
17-
# default: ''
18-
# required: false
19-
# type: string
14+
2015
outputs:
2116
package-name:
2217
description: 'Name of the package'
@@ -48,17 +43,17 @@ runs:
4843
>> $GITHUB_OUTPUT
4944
shell: bash
5045

51-
- name: Publish python package
46+
- name: Publish python package to test.pypi
5247
run: uv publish
5348
env:
54-
UV_PUBLISH_URL: https://${{ inputs.pypi }}.org/legacy/
49+
UV_PUBLISH_URL: https://test.pypi.org/legacy/
5550
# UV_PUBLISH_TOKEN: ${{ secrets.pypi_token }}
5651
shell: bash
5752

58-
# - name: Publish python package
59-
# uses: pypa/gh-action-pypi-publish@release/v1
60-
# with:
61-
# repository-url: https://${{ inputs.pypi }}.org/legacy/
62-
# # password: ${{ secrets.pypi_token }}
63-
# verbose: true
64-
53+
- name: Publish python package to pypi.org
54+
if: ${{ inputs.test-only != 'true' }}
55+
run: uv publish
56+
env:
57+
UV_PUBLISH_URL: https://pypi.org/legacy/
58+
# UV_PUBLISH_TOKEN: ${{ secrets.pypi_token }}
59+
shell: bash

0 commit comments

Comments
 (0)