Skip to content

Commit

Permalink
Publish to Pypi after releasing the draft release
Browse files Browse the repository at this point in the history
  • Loading branch information
celynw committed Jan 29, 2024
1 parent 5255e6a commit 88ce52f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 24 deletions.
25 changes: 1 addition & 24 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,32 +41,9 @@ jobs:
- name: Unit tests
run: pytest --disable-warnings -vvs kellog/tests

publish:
name: Publish to PyPI
needs: test
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install with dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

release:
name: Create release
needs: publish
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Publish Release
on:
release:
types: [published]

jobs:
publish:
name: Publish to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install with dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit 88ce52f

Please sign in to comment.