Skip to content

Commit

Permalink
Fix publish.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
bindreams committed Apr 28, 2024
1 parent 3b84361 commit f550c64
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# See also:
# https://github.com/pypa/gh-action-pypi-publish
# https://docs.pypi.org/trusted-publishers/creating-a-project-through-oidc/
name: Publish

on:
Expand All @@ -14,27 +17,19 @@ on:

jobs:
publish:
name: Publish to ${{ options.repository }}
name: Publish to ${{ inputs.repository }}
runs-on: ubuntu-latest
environment:
name: publish-${{ inputs.repository }}
permissions:
id-token: write
steps:
- uses: actions/checkout@v4 # Required to use a dependent workflow
- 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
with:
repository-url: $UPLOAD_URL

0 comments on commit f550c64

Please sign in to comment.