Skip to content

Publish

Publish #1

Workflow file for this run

# See also:
# https://github.com/pypa/gh-action-pypi-publish
# https://docs.pypi.org/trusted-publishers/creating-a-project-through-oidc/
name: Publish
on:
workflow_dispatch:
inputs:
repository:
description: Target repository
type: choice
options: [PyPI, TestPyPI]
default: TestPyPI
required: true
release:
types: [published]
jobs:
publish:
name: Publish to ${{ options.repository }}

Check failure on line 20 in .github/workflows/publish.yaml

View workflow run for this annotation

GitHub Actions / Publish

Invalid workflow file

The workflow is not valid. .github/workflows/publish.yaml (Line: 20, Col: 11): Unrecognized named-value: 'options'. Located at position 1 within expression: options.repository .github/workflows/publish.yaml (Line: 23, Col: 13): Unrecognized named-value: 'options'. Located at position 1 within expression: options.repository
runs-on: ubuntu-latest
environment:
name: publish-${{ options.repository }}
permissions:
id-token: write
steps:
- uses: ./.github/workflows/build.yaml
- uses: actions/download-artifact@v4
with:
pattern: package-*
path: dist
merge-multiple: true
- name: Determine upload URL
run: |
case "${{ inputs.repository }}" in
"TestPyPI") URL="https://test.pypi.org/legacy/";;
"PyPI") URL="https://upload.pypi.org/legacy/";;
*) echo "Incorrect input"; exit 1;;
esac
echo "UPLOAD_URL=$URL" >> "$GITHUB_ENV"
- uses: pypa/gh-action-pypi-publish@release/v1