Skip to content

Commit b946bb5

Browse files
authored
ci: dispatch beta release via execute-workflow instead of inlining (#890)
Replaces the inlined beta release jobs in `on_master.yaml` with a single job that dispatches `manual_release_beta.yaml` via `apify/workflows/execute-workflow@main`. The dispatched run is a regular `workflow_dispatch` (not a reusable workflow call), so PyPI's Trusted Publishing accepts the OIDC token, and the duplication is gone. Also adds a `concurrency: release` group to `manual_release_beta.yaml` so two rapid pushes to master cannot race on the version bump and PyPI publish. Same pattern as `apify-client-js`, `apify-sdk-js`, `apify-cli`, and `crawlee`.
1 parent 13be21b commit b946bb5

2 files changed

Lines changed: 18 additions & 9 deletions

File tree

.github/workflows/manual_release_beta.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
name: Beta release
22

33
on:
4-
# Runs when manually triggered from the GitHub UI.
4+
# Runs when manually triggered from the GitHub UI, or dispatched from `on_master.yaml`
5+
# via the `apify/workflows/execute-workflow` action for the automatic beta release on push to master.
6+
# Note: This workflow is intentionally NOT a reusable workflow (no `workflow_call`) because PyPI's
7+
# Trusted Publishing does not currently support reusable workflows.
8+
# See: https://docs.pypi.org/trusted-publishers/troubleshooting/#reusable-workflows-on-github
59
workflow_dispatch:
610

7-
# Runs when invoked by another workflow.
8-
workflow_call:
11+
concurrency:
12+
group: release
13+
cancel-in-progress: false
914

1015
permissions:
1116
contents: read
@@ -16,7 +21,6 @@ jobs:
1621
runs-on: ubuntu-latest
1722
outputs:
1823
version_number: ${{ steps.release_prepare.outputs.version_number }}
19-
tag_name: ${{ steps.release_prepare.outputs.tag_name }}
2024
changelog: ${{ steps.release_prepare.outputs.changelog }}
2125
steps:
2226
- uses: apify/workflows/git-cliff-release@main

.github/workflows/on_master.yaml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ jobs:
4545
uses: ./.github/workflows/_tests.yaml
4646
secrets: inherit
4747

48+
# The beta release is dispatched as a separate workflow run (instead of calling `manual_release_beta.yaml` via `uses:`)
49+
# because PyPI's Trusted Publishing does not currently support reusable workflows.
50+
# See: https://docs.pypi.org/trusted-publishers/troubleshooting/#reusable-workflows-on-github
4851
beta_release:
4952
# Run this only for "feat", "fix", "perf", "refactor" and "style" commits.
5053
if: >-
@@ -55,9 +58,11 @@ jobs:
5558
startsWith(github.event.head_commit.message, 'style')
5659
name: Beta release
5760
needs: [code_checks, tests]
61+
runs-on: ubuntu-latest
5862
permissions:
59-
contents: write
60-
id-token: write
61-
pages: write
62-
uses: ./.github/workflows/manual_release_beta.yaml
63-
secrets: inherit
63+
actions: write # Required by execute-workflow.
64+
steps:
65+
- name: Dispatch beta release workflow
66+
uses: apify/workflows/execute-workflow@main
67+
with:
68+
workflow: manual_release_beta.yaml

0 commit comments

Comments
 (0)