Skip to content

Commit

Permalink
fix(ci): add token and password
Browse files Browse the repository at this point in the history
  • Loading branch information
ninopleno committed Dec 5, 2023
1 parent 0b6db3f commit 74feae8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/cd-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
Expand All @@ -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
Expand All @@ -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
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/cd-stg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
Expand All @@ -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
Expand All @@ -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

0 comments on commit 74feae8

Please sign in to comment.