From e333ca37642cab5c6c1ad5a88dc2bc1a5b9b1cad Mon Sep 17 00:00:00 2001 From: Mingjie Jian Date: Sat, 20 Jan 2024 07:17:27 +0900 Subject: [PATCH] modify release.yml - 4 --- .github/workflows/release.yml | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 34dd3bd5..feab9e34 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,20 +3,41 @@ name: pypi-publish on: push jobs: - pypi-publish: - name: upload release to PyPI + build: + name: Build distribution runs-on: ubuntu-latest - # Specifying a GitHub environment is optional, but strongly encouraged - environment: release - permissions: - # IMPORTANT: this permission is mandatory for trusted publishing - id-token: write steps: # retrieve your distributions here + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.x" + - name: Build a binary wheel and a source tarball + run: python3 setup.py sdist - name: Upload all the dists uses: actions/upload-artifact@v4 with: name: python-package-distributions path: dist/ - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + + publish-to-pypi: + name: Publish to PyPI + needs: + - build + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/pymoog # Replace with your PyPI project name + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution to PyPI uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file