From 2e4908b3c1c2dc7351fd8829ee83ef754f0c6375 Mon Sep 17 00:00:00 2001 From: 简律纯 Date: Tue, 4 Jul 2023 12:32:32 +0800 Subject: Update python-publish.yml --- .github/workflows/python-publish.yml | 50 ++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 25 deletions(-) (limited to '.github/workflows/python-publish.yml') diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index ba5bf1c7..2464c134 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -1,31 +1,31 @@ -# This workflow will upload a Python Package using Twine when a release is created -# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries - -name: Upload Python Package - on: - release: - types: [created] + push: + tags: + - "v*" + workflow_dispatch: jobs: - deploy: - + build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.9' - - name: Install dependencies - run: | - python3 -m pip install --upgrade build - python3 -m pip install --user --upgrade twine - - name: Build and publish - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - python3 -m build - python3 -m twine upload dist/* + - uses: actions/checkout@v3 + + - name: Install poetry + run: pipx install poetry + shell: bash + - uses: actions/setup-python@v4 + with: + python-version: "3.9" + architecture: "x64" + cache: "poetry" + - run: poetry install + shell: bash + + - run: poetry config pypi-token.pypi "$PYPI_TOKEN" + shell: bash + env: + PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} + + - run: poetry publish --build + shell: bash -- cgit v1.2.3-70-g09d2