add pypi publish workflow

This commit is contained in:
smf
2024-04-19 11:54:20 +08:00
parent 222588ab2a
commit 3a2254488e

34
.github/workflows/publish_pypi.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
on:
workflow_call:
inputs:
artifact-skip:
required: false
type: boolean
default: false
artifact-name:
required: false
type: string
default: 'artifact'
runs_on:
required: false
type: string
default: 'ubuntu_act_on_20'
jobs:
publish-docker-image:
runs-on: ${{ inputs.runs_on }}
# container:
# image: catthehacker/ubuntu:act-latest
env:
RUNNER_TOOL_CACHE: /toolcache
steps:
- uses: actions/download-artifact@v3
if: ${{ inputs.artifact-skip != true }}
with:
name: ${{ inputs.artifact-name }}
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
packages-dir: pub/