Skip to content

Publish to TestPyPI using Poetry #12

Publish to TestPyPI using Poetry

Publish to TestPyPI using Poetry #12

Workflow file for this run

name: Publish to TestPyPI using Poetry
on:
push:
tags:
- 'v1*' # only when the commit was tagged with a tag starting with v0
workflow_dispatch:
jobs:
build:
if: github.ref_name == 'master'
runs-on: ubuntu-latest
environment:
name: pypi
url: https://test.pypi.org/p/openwfs
permissions:
id-token: write # Required for OIDC
steps:
# Checkout the repository
- name: Check out the repository
uses: actions/checkout@v3
# Set up Python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
# Install Poetry
- name: Install Poetry
uses: abatilo/actions-poetry@v2
with:
version: '1.8.3'
# Install dependencies and build the project
- name: Install dependencies and build package
run: |
poetry install
poetry build
- name: Publish package distributions to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
verbose: true
- name: Publish package distributions to the true PyPI
if: ${{ !contains(github.ref, 'rc')}} # don't publish release candidates to PyPI, use these only for testing
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true