push debug print jobs into main job to simplify PR checks #4
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
# **what?** | |
# Releases artifacts to PyPI. | |
# | |
# **when?** | |
# Call after a successful build. Build artifacts should be ready to release.defaults: | |
# They need to either live in a dist/ directory locally, or an archive name needs to be provided. | |
name: "Publish to PyPI" | |
run-name: "Publish `${{ version }}` to PyPI in ${{ deploy-to }}" | |
on: | |
workflow_dispatch: | |
inputs: | |
archive-name: | |
description: "Name of the archive containing the artifacts, leave blank if local" | |
default: "" | |
version: | |
description: "The release version number (i.e. 1.0.0b1)" | |
type: string | |
required: true | |
deploy-to: | |
description: "Choose where to publish" | |
type: choice | |
options: | |
- "prod" | |
- "test" | |
workflow_call: | |
inputs: | |
archive-name: | |
description: "Name of the archive containing the artifacts, leave blank if local" | |
type: string | |
default: "" | |
version: | |
description: "The release version number (i.e. 1.0.0b1)" | |
type: string | |
required: true | |
deploy-to: | |
description: "Choose where to publish" | |
type: string | |
default: "prod" | |
permissions: | |
contents: write | |
# will cancel previous workflows triggered by the same event and for the same package and environment | |
concurrency: | |
group: ${{ github.workflow }}-${{ inputs.archive-name }}-${{ inputs.version }}-${{ inputs.deploy-to }} | |
cancel-in-progress: true | |
env: | |
NOTIFICATION_PREFIX: "[Publish - PyPI]" | |
jobs: | |
debug-inputs: | |
name: "[DEBUG] Inputs" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "[DEBUG] Inputs" | |
run: | | |
echo archive-name : ${{ inputs.archive-name }} | |
echo version : ${{ inputs.version }} | |
echo deploy-to : ${{ inputs.deploy-to }} | |
echo PYPI_PROJECT_URL : ${{ vars.PYPI_PROJECT_URL }} | |
echo PYPI_REPOSITORY_URL : ${{ vars.PYPI_REPOSITORY_URL }} | |
pypi-release: | |
name: "Publish to PyPI" | |
runs-on: ubuntu-latest | |
environment: | |
name: ${{ inputs.deploy-to }} | |
url: ${{ vars.PYPI_PROJECT_URL }} | |
steps: | |
- name: "Check out `main`" | |
uses: actions/checkout@v4 | |
- name: "Publish to PyPI" | |
uses: .github/actions/publish-pypi | |
with: | |
repository-url: ${{ vars.PYPI_REPOSITORY_URL }} | |
archive-name: ${{ inputs.archive-name }} |