Skip to content

Commit fecca3a

Browse files
authored
ci: dispatch beta release via execute-workflow instead of inlining (#63)
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 55e4041 commit fecca3a

2 files changed

Lines changed: 18 additions & 8 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 & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,19 @@ jobs:
2222
name: Tests
2323
uses: ./.github/workflows/_tests.yaml
2424

25+
# The beta release is dispatched as a separate workflow run (instead of calling `manual_release_beta.yaml` via `uses:`)
26+
# because PyPI's Trusted Publishing does not currently support reusable workflows.
27+
# See: https://docs.pypi.org/trusted-publishers/troubleshooting/#reusable-workflows-on-github
2528
beta_release:
2629
# Skip this for "ci", "docs" and "test" commits and for forks.
2730
if: "!startsWith(github.event.head_commit.message, 'ci') && !startsWith(github.event.head_commit.message, 'docs') && !startsWith(github.event.head_commit.message, 'test') && startsWith(github.repository, 'apify/')"
2831
name: Beta release
2932
needs: [code_checks, tests]
33+
runs-on: ubuntu-latest
3034
permissions:
31-
contents: write
32-
id-token: write
33-
uses: ./.github/workflows/manual_release_beta.yaml
34-
secrets: inherit
35+
actions: write # Required by execute-workflow.
36+
steps:
37+
- name: Dispatch beta release workflow
38+
uses: apify/workflows/execute-workflow@main
39+
with:
40+
workflow: manual_release_beta.yaml

0 commit comments

Comments
 (0)