Skip to content

Commit 05a89db

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 60136c8 commit 05a89db

2 files changed

Lines changed: 15 additions & 61 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`) because PyPI's Trusted Publishing
6-
# does not currently support reusable workflows. The same jobs are duplicated in `on_master.yaml` for the automatic
7-
# 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 & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -49,74 +49,24 @@ jobs:
4949
uses: ./.github/workflows/_tests.yaml
5050
secrets: inherit
5151

52-
# The beta release jobs are intentionally inlined here (instead of calling `manual_release_beta.yaml` via `uses:`)
52+
# The beta release is dispatched as a separate workflow run (instead of calling `manual_release_beta.yaml` via `uses:`)
5353
# because PyPI's Trusted Publishing does not currently support reusable workflows.
5454
# See: https://docs.pypi.org/trusted-publishers/troubleshooting/#reusable-workflows-on-github
55-
release_prepare:
55+
beta_release:
5656
# Run this only for "feat", "fix", "perf", "refactor" and "style" commits.
5757
if: >-
5858
startsWith(github.event.head_commit.message, 'feat') ||
5959
startsWith(github.event.head_commit.message, 'fix') ||
6060
startsWith(github.event.head_commit.message, 'perf') ||
6161
startsWith(github.event.head_commit.message, 'refactor') ||
6262
startsWith(github.event.head_commit.message, 'style')
63-
name: Beta release / Release prepare
63+
name: Beta release
6464
needs: [code_checks, docstrings_checks, tests]
6565
runs-on: ubuntu-latest
66-
outputs:
67-
version_number: ${{ steps.release_prepare.outputs.version_number }}
68-
changelog: ${{ steps.release_prepare.outputs.changelog }}
69-
steps:
70-
- uses: apify/workflows/git-cliff-release@main
71-
id: release_prepare
72-
name: Release prepare
73-
with:
74-
release_type: prerelease
75-
existing_changelog_path: CHANGELOG.md
76-
77-
changelog_update:
78-
name: Beta release / Changelog update
79-
needs: [release_prepare]
80-
permissions:
81-
contents: write
82-
uses: apify/workflows/.github/workflows/python_bump_and_update_changelog.yaml@main
83-
with:
84-
version_number: ${{ needs.release_prepare.outputs.version_number }}
85-
changelog: ${{ needs.release_prepare.outputs.changelog }}
86-
secrets: inherit
87-
88-
pypi_publish:
89-
name: Beta release / PyPI publish
90-
needs: [release_prepare, changelog_update]
91-
runs-on: ubuntu-latest
9266
permissions:
93-
contents: write
94-
id-token: write # Required for OIDC authentication.
95-
environment:
96-
name: pypi
97-
url: https://pypi.org/project/apify-client
67+
actions: write # Required by execute-workflow.
9868
steps:
99-
- name: Prepare distribution
100-
uses: apify/workflows/prepare-pypi-distribution@main
69+
- name: Dispatch beta release workflow
70+
uses: apify/workflows/execute-workflow@main
10171
with:
102-
package_name: apify-client
103-
is_prerelease: "yes"
104-
version_number: ${{ needs.release_prepare.outputs.version_number }}
105-
ref: ${{ needs.changelog_update.outputs.changelog_commitish }}
106-
107-
# Publish the package to PyPI using PyPA official GitHub action with OIDC authentication.
108-
- name: Publish package to PyPI
109-
uses: pypa/gh-action-pypi-publish@release/v1
110-
111-
doc_release_post_publish:
112-
name: Beta release / Doc release post publish
113-
needs: [changelog_update, pypi_publish]
114-
permissions:
115-
contents: write
116-
pages: write
117-
id-token: write
118-
uses: ./.github/workflows/manual_release_docs.yaml
119-
with:
120-
# Use the ref from the changelog update to include the updated changelog.
121-
ref: ${{ needs.changelog_update.outputs.changelog_commitish }}
122-
secrets: inherit
72+
workflow: manual_release_beta.yaml

0 commit comments

Comments
 (0)