From 74feae8265a130d3c258987863b9ae939371d5f7 Mon Sep 17 00:00:00 2001 From: "N. L." Date: Tue, 5 Dec 2023 01:34:48 +0100 Subject: [PATCH] fix(ci): add token and password --- .github/workflows/cd-prod.yaml | 24 ++++++++++++------------ .github/workflows/cd-stg.yaml | 12 +++++++++--- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/.github/workflows/cd-prod.yaml b/.github/workflows/cd-prod.yaml index 4cd42f7..1c59e59 100644 --- a/.github/workflows/cd-prod.yaml +++ b/.github/workflows/cd-prod.yaml @@ -7,7 +7,12 @@ on: - "v*.*.*" jobs: - build-distribution: + build-pypi-distribution: + strategy: + matrix: + os: [ubuntu-latest] + python-version: [3.12] + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4.1.0 @@ -17,25 +22,20 @@ jobs: python-version: ${{ matrix.python-version }} cache: "pip" - name: Install pypa/build - run: >- - python3 -m - pip install - build - --user + run: python3 -m pip install build --user - name: Build a binary wheel and a source tarball - run: python3 -m build + run: python3 -m build . - name: Store the distribution packages uses: actions/upload-artifact@v3 with: name: python-package-distributions path: dist/ - publish-to-pypi: - name: >- - Publish Python 🐍 distribution 📦 to PyPI + pypi-publish: + name: Publish Python 🐍 distribution 📦 to PyPI if: startsWith(github.ref, 'refs/tags/') needs: - - build-distribution + - build-pypi-distribution runs-on: ubuntu-latest environment: name: pypi @@ -56,7 +56,7 @@ jobs: Sign the Python 🐍 distribution 📦 with Sigstore and upload them to GitHub Release needs: - - publish-to-pypi + - pypi-publish runs-on: ubuntu-latest permissions: contents: write diff --git a/.github/workflows/cd-stg.yaml b/.github/workflows/cd-stg.yaml index 6937f39..5be62da 100644 --- a/.github/workflows/cd-stg.yaml +++ b/.github/workflows/cd-stg.yaml @@ -11,7 +11,11 @@ on: - completed jobs: - build-staging-distribution: + build-testpypi-distribution: + strategy: + matrix: + os: [ubuntu-latest] + python-version: [3.12] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4.1.0 @@ -34,10 +38,10 @@ jobs: name: python-package-distributions path: dist/ - publish-to-testpypi: + testpypi-publish: name: Publish Python 🐍 distribution 📦 to TestPyPI needs: - - build-staging-distribution + - build-testpypi-distribution runs-on: ubuntu-latest environment: name: testpypi @@ -53,4 +57,6 @@ jobs: - name: Publish distribution 📦 to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 with: + password: ${{ secrets.TEST_PYPI_API_TOKEN }} repository-url: https://test.pypi.org/legacy/ + verbose: true