Skip to content

Merge pull request #208 from PyFixate/release-prep #9

Merge pull request #208 from PyFixate/release-prep

Merge pull request #208 from PyFixate/release-prep #9

Workflow file for this run

# This workflow will build the package and publish to TestPyPi
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Build and publish to PyPi
on:
push:
tags:
- '*'
workflow_dispatch:
jobs:
run-workflow-tests:
name: Run Workflow Tests
uses: ./.github/workflows/test.yml
build-n-publish:
name: Build and Publish to PyPi
runs-on: ubuntu-latest
needs: [run-workflow-tests]
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install build
run: |
python -m pip install --upgrade pip
python -m pip install build --user
- name: Build the package
run: |
python -m build --sdist --wheel --outdir dist/ .
- name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}