Skip to content

Commit

Permalink
Separate pypi workflows (#41)
Browse files Browse the repository at this point in the history
* Create publish-to-testpypi

* Update publish-to-testpypi

* Update publish-to-pypi.yml

* Update publish-to-pypi.yml

* Update publish-to-testpypi
  • Loading branch information
gisellerosetta authored Oct 11, 2023
1 parent 018b64c commit 343ed7f
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 7 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
name: Publish Python 🐍 distributions 📦 to PyPI

on:
push:
Expand All @@ -10,7 +10,7 @@ on:

jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -31,11 +31,6 @@ jobs:
--sdist
--wheel
--outdir dist/
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
- name: Publish distribution 📦 to PyPI
if: startsWith(github.event.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/publish-to-testpypi
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish Python 🐍 distributions 📦 to TestPyPI

on:
push:
branches:
- main

jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to TestPyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python3 -m
build
--sdist
--wheel
--outdir dist/
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/

0 comments on commit 343ed7f

Please sign in to comment.