[workflows] update python-publish

This commit is contained in:
kabeor 2023-06-18 18:12:31 +08:00
parent 4d78859852
commit 7d2e04068e
1 changed files with 13 additions and 14 deletions

View File

@ -1,6 +1,8 @@
name: PyPI 📦 Distribution name: PyPI 📦 Distribution
on: [push] on:
push:
workflow_dispatch:
jobs: jobs:
build: build:
@ -58,23 +60,20 @@ jobs:
publish: publish:
needs: [build] needs: [build]
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags') if: startsWith(github.ref, 'refs/tags') || github.event_name == 'workflow_dispatch'
permissions:
id-token: write
steps: steps:
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v2
with: with:
name: artifact name: artifact
path: dist path: dist
# - name: Publish distribution 📦 to test PyPI - name: Publish distribution 📦 to test PyPI
# uses: pypa/gh-action-pypi-publish@master uses: pypa/gh-action-pypi-publish@release/v1
# with:
# user: __token__
# password: ${{ secrets.testpypi_pass }}
# repository_url: https://test.pypi.org/legacy/
- name: Publish distribution 📦 to PyPI
if: ${{ success() }}
uses: pypa/gh-action-pypi-publish@master
with: with:
user: __token__ repository_url: https://test.pypi.org/legacy/
password: ${{ secrets.pypi_pass }}
# - name: Publish distribution 📦 to PyPI
# if: ${{ success() }}
# uses: pypa/gh-action-pypi-publish@release/v1