Bumps [dawidd6/action-download-artifact](https://github.com/dawidd6/action-download-artifact) from 14 to 15.
- [Release notes](https://github.com/dawidd6/action-download-artifact/releases)
- [Commits](5c98f0b039...fe9d59ce33)
---
updated-dependencies:
- dependency-name: dawidd6/action-download-artifact
dependency-version: '15'
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
61 lines
2.3 KiB
YAML
61 lines
2.3 KiB
YAML
name: Publish to PyPI
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
run_id:
|
|
description: The run of wheel-builder to use for finding artifacts.
|
|
required: true
|
|
environment:
|
|
description: Which PyPI environment to upload to
|
|
required: true
|
|
type: choice
|
|
options: ["testpypi", "pypi"]
|
|
workflow_run:
|
|
workflows: ["Wheel Builder"]
|
|
types: [completed]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
# We're not actually verifying that the triggering push event was for a
|
|
# tag, because github doesn't expose enough information to do so.
|
|
# wheel-builder.yml currently only has push events for tags.
|
|
if: github.event_name == 'workflow_dispatch' || (github.event.workflow_run.event == 'push' && github.event.workflow_run.conclusion == 'success')
|
|
permissions:
|
|
id-token: "write"
|
|
attestations: "write"
|
|
steps:
|
|
- run: echo "$EVENT_CONTEXT"
|
|
env:
|
|
EVENT_CONTEXT: ${{ toJson(github.event) }}
|
|
|
|
- run: |
|
|
echo "PYPI_URL=https://upload.pypi.org/legacy/" >> $GITHUB_ENV
|
|
if: github.event_name == 'workflow_run' || (github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'pypi')
|
|
- run: |
|
|
echo "PYPI_URL=https://test.pypi.org/legacy/" >> $GITHUB_ENV
|
|
if: github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'testpypi'
|
|
|
|
- uses: dawidd6/action-download-artifact@fe9d59ce33ce92db8a6ac90b2c8be6b6d90417c8 # v15
|
|
with:
|
|
path: tmpdist/
|
|
run_id: ${{ github.event.inputs.run_id || github.event.workflow_run.id }}
|
|
- run: mkdir dist/
|
|
- run: |
|
|
find tmpdist/ -type f -name 'bcrypt*' -exec mv {} dist/ \;
|
|
|
|
- name: Publish package distributions to PyPI
|
|
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
|
|
with:
|
|
repository-url: ${{ env.PYPI_URL }}
|
|
skip-existing: true
|
|
# Do not perform attestation for things for TestPyPI. This is
|
|
# because there's nothing that would prevent a malicious PyPI from
|
|
# serving a signed TestPyPI asset in place of a release intended for
|
|
# PyPI.
|
|
attestations: ${{ env.PYPI_URL == 'https://upload.pypi.org/legacy/' }}
|