Skip to content

Commit

Permalink
[workflow] Complete the "pypi" action implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
tkoeppe committed Jul 20, 2023
1 parent 98d6007 commit fdf60bc
Showing 1 changed file with 28 additions and 9 deletions.
37 changes: 28 additions & 9 deletions .github/workflows/pypi_upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,17 @@ name: pypi_upload
on:
workflow_dispatch:
inputs:
release:
description: 'Release to upload'
type: string
default: ''
upload_to_test_pypi:
description: 'Upload to Test PyPi'
type: boolean
default: true
upload_to_pypi:
description: 'Whether to upload to PyPi'
required: false
description: 'Upload to PyPi'
type: boolean
default: false
release:
types: [published]
Expand All @@ -16,18 +24,29 @@ jobs:
upload-wheels-to-pypi:
name: Upload wheels to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/dmlab2d
permissions:
id-token: write
timeout-minutes: 30

env:
GH_TOKEN: ${{ github.token }}

steps:
- name: Download all wheels
uses: actions/download-artifact@
- name: Download release assets
run: gh release download ${{ inputs.release || github.ref }} -D dist -R ${{ github.repository }}

- name: Publish to TestPyPI
if: github.event_name == 'release' || inputs.upload_to_test_pypi
uses: pypa/gh-action-pypi-publish@release/v1
with:
name: wheels-${{ github.ref_name }}
repository-url: https://test.pypi.org/legacy/
verbose: true

- name: List contents
run: |
gh release download ${{ github.ref }} -D dist -R ${{ github.repository }}
ls -la dist
- name: Publish to PyPI
if: github.event_name == 'release' || inputs.upload_to_pypi
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true

0 comments on commit fdf60bc

Please sign in to comment.