Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 28 additions & 6 deletions .github/workflows/publish_to_pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,13 @@ permissions:
contents: read

jobs:
pypi_publish:
name: PyPI publish
# Runs without `id-token: write`, so the build (the composite actions and the project's dev dependencies) can't
# request a PyPI token. Only the `pypi_publish` job below can.
build:
name: Build
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # Required for OIDC authentication.
environment:
name: pypi
url: https://pypi.org/project/apify-client
steps:
# Also pins the ref to a commit, so the checked commit is the one that gets built.
- name: Check that the ref is on a release branch
Expand Down Expand Up @@ -78,6 +76,30 @@ jobs:
ApifyClient(token='x')
ApifyClientAsync(token='x')

- name: Upload distribution
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: dist
path: dist/
if-no-files-found: error
retention-days: 1

pypi_publish:
name: PyPI publish
needs: build
runs-on: ubuntu-latest
permissions:
id-token: write # Required for OIDC authentication.
environment:
name: pypi
url: https://pypi.org/project/apify-client
steps:
- name: Download distribution
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: dist
path: dist/

# Publish the package to PyPI using PyPA official GitHub action with OIDC authentication.
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # release/v1
Loading