Skip to content

Publish a release to PyPI #8

Publish a release to PyPI

Publish a release to PyPI #8

Workflow file for this run

name: Publish a release to PyPI
on:
workflow_dispatch:
inputs:
test_pypi:
type: boolean
default: false
description: "Publish to the test PyPI instance, https://test.pypi.org/"
jobs:
build:
permissions:
id-token: write
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install Development Dependencies
run: |
pip install pip --upgrade
pip install ".[dev]"
- name: Build Source Distribution and Wheel
run: pdm build
- name: Publish adam_core to Test PyPI
if: ${{ inputs.test_pypi }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_SECRET }}
repository-url: https://test.pypi.org/legacy/
- name: Publish adam_core to PyPI
if: ${{ ! inputs.test_pypi }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_SECRET }}