Skip to content

Publish package to TEST_PyPI and PyPI #12

Publish package to TEST_PyPI and PyPI

Publish package to TEST_PyPI and PyPI #12

Workflow file for this run

name: Publish package to TEST_PyPI and PyPI
on:
release:
types: [published]
jobs:
build-and-publish:
name: 'Build nso-applet-api'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11.4'
- name: Install pypa/build
if: startsWith(github.ref, 'refs/tags')
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
if: startsWith(github.ref, 'refs/tags')
run: >-
python3 -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publish distribution to Test PyPI
if: startsWith(github.ref, 'refs/tags/b')
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.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}