Publish to Pypi - Fairlens_pe #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish to Pypi - Fairlens_pe | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version to 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: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v3 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install wheel | |
- name: Update version.txt | |
run: echo "${{ github.event.inputs.version }}" > version.txt | |
- name: Build package | |
run: python setup.py sdist bdist_wheel | |
env: | |
VERSION: ${{ github.event.inputs.version }} | |
- name: Publish package to TestPyPI | |
uses: pypa/[email protected] | |
with: | |
user: __token__ | |
password: ${{ secrets.TEST_PYPI_TOKEN }} | |
repository_url: https://test.pypi.org/legacy/ | |
if: ${{ github.event.inputs.pypi_repo == 'testpypi' }} | |
- name: Publish package to PyPI | |
uses: pypa/[email protected] | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_TOKEN }} | |
if: ${{ github.event.inputs.pypi_repo == 'pypi' }} |