Skip to content

Commit

Permalink
Merge pull request #46 from GauravPandeyLab/continuous-deployment
Browse files Browse the repository at this point in the history
Release on PyPI or Test PyPI
  • Loading branch information
03bennej committed Dec 13, 2023
2 parents e82f34e + 8b1bb49 commit 4e65d2c
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/publish_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Publish to Pypi
on:
workflow_dispatch:
inputs:
version:
description: 'Version upload to pypi'
required: true
pypi_repo:
description: 'Repo to upload to (testpypi or pypi)'
default: 'testpypi'
required: true

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.8'

- name: Install poetry
run: |
pip install poetry
- name: Install dependencies
run: |
poetry install
- name: Publish package to TestPyPI
run: |
poetry config repositories.test-pypi https://test.pypi.org/legacy/
poetry config pypi-token.test-pypi ${{ secrets.TEST_PYPI_TOKEN }}
poetry publish --build
if: ${{ github.event.inputs.pypi_repo == 'testpypi' }}

- name: Publish package to PyPI
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
poetry publish --build
if: ${{ github.event.inputs.pypi_repo == 'pypi' }}

0 comments on commit 4e65d2c

Please sign in to comment.