Skip to content

Commit 470ad86

Browse files
vdusekclaude
andcommitted
ci: dispatch beta release via execute-workflow instead of inlining
Use apify/workflows/execute-workflow@main to trigger manual_release_beta.yaml as a separate workflow run (not a reusable workflow call), so PyPI's Trusted Publishing accepts the OIDC token. This removes the duplication between on_master.yaml and manual_release_beta.yaml introduced by the previous inline approach. Add a concurrency group to manual_release_beta.yaml so two rapid pushes to master cannot race on the version bump and PyPI publish. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 0a67ff1 commit 470ad86

2 files changed

Lines changed: 15 additions & 48 deletions

File tree

.github/workflows/manual_release_beta.yaml

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

33
on:
4-
# Runs when manually triggered from the GitHub UI.
5-
# Note: This workflow is intentionally NOT a reusable workflow (no `workflow_call`)
6-
# because PyPI's Trusted Publishing does not currently support reusable workflows.
7-
# The same jobs are duplicated in `on_master.yaml` for the automatic beta release on push to master.
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.
88
# See: https://docs.pypi.org/trusted-publishers/troubleshooting/#reusable-workflows-on-github
99
workflow_dispatch:
1010

11+
concurrency:
12+
group: release
13+
cancel-in-progress: false
14+
1115
permissions:
1216
contents: read
1317

.github/workflows/on_master.yaml

Lines changed: 7 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -22,56 +22,19 @@ jobs:
2222
name: Tests
2323
uses: ./.github/workflows/_tests.yaml
2424

25-
# The beta release jobs are intentionally inlined here (instead of calling `manual_release_beta.yaml` via `uses:`)
25+
# The beta release is dispatched as a separate workflow run (instead of calling `manual_release_beta.yaml` via `uses:`)
2626
# because PyPI's Trusted Publishing does not currently support reusable workflows.
2727
# See: https://docs.pypi.org/trusted-publishers/troubleshooting/#reusable-workflows-on-github
28-
release_prepare:
28+
beta_release:
2929
# Skip this for "ci", "docs" and "test" commits and for forks.
3030
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/')"
31-
name: Beta release / Release prepare
31+
name: Beta release
3232
needs: [code_checks, tests]
3333
runs-on: ubuntu-latest
34-
outputs:
35-
version_number: ${{ steps.release_prepare.outputs.version_number }}
36-
changelog: ${{ steps.release_prepare.outputs.changelog }}
37-
steps:
38-
- uses: apify/workflows/git-cliff-release@main
39-
id: release_prepare
40-
name: Release prepare
41-
with:
42-
release_type: prerelease
43-
existing_changelog_path: CHANGELOG.md
44-
45-
changelog_update:
46-
name: Beta release / Changelog update
47-
needs: [release_prepare]
4834
permissions:
49-
contents: write
50-
uses: apify/workflows/.github/workflows/python_bump_and_update_changelog.yaml@main
51-
with:
52-
version_number: ${{ needs.release_prepare.outputs.version_number }}
53-
changelog: ${{ needs.release_prepare.outputs.changelog }}
54-
secrets: inherit
55-
56-
pypi_publish:
57-
name: Beta release / PyPI publish
58-
needs: [release_prepare, changelog_update]
59-
runs-on: ubuntu-latest
60-
permissions:
61-
contents: write
62-
id-token: write # Required for OIDC authentication.
63-
environment:
64-
name: pypi
65-
url: https://pypi.org/project/apify-shared
35+
actions: write # Required by execute-workflow.
6636
steps:
67-
- name: Prepare distribution
68-
uses: apify/workflows/prepare-pypi-distribution@main
37+
- name: Dispatch beta release workflow
38+
uses: apify/workflows/execute-workflow@main
6939
with:
70-
package_name: apify-shared
71-
is_prerelease: "yes"
72-
version_number: ${{ needs.release_prepare.outputs.version_number }}
73-
ref: ${{ needs.changelog_update.outputs.changelog_commitish }}
74-
75-
# Publish the package to PyPI using PyPA official GitHub action with OIDC authentication.
76-
- name: Publish package to PyPI
77-
uses: pypa/gh-action-pypi-publish@release/v1
40+
workflow: manual_release_beta.yaml

0 commit comments

Comments
 (0)