Skip to content

Commit 7256687

Browse files
authored
ci: add manually triggerable beta release workflow (#61)
## Summary - Extract the beta release pipeline (`release_prepare` → `changelog_update` → `pypi_publish`) from `on_master.yaml` into a new `manual_release_beta.yaml` reusable workflow. - The new workflow exposes both `workflow_dispatch` (manual trigger from the GitHub UI) and `workflow_call` (so `on_master` can keep auto-publishing betas after master pushes). - `on_master.yaml` now has a single `beta_release` job that calls the new workflow, preserving the existing skip condition (`!ci`/`!docs`/`!test` + `apify/` org gate) and `code_checks` + `tests` dependencies. ## Why We previously had no way to cut a beta without pushing a release-triggering commit to master. With this change, a beta can be released on demand from the Actions tab, while the existing automatic flow on master is preserved. Mirrors apify/apify-sdk-python#886.
1 parent 383cb56 commit 7256687

2 files changed

Lines changed: 66 additions & 43 deletions

File tree

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Beta release
2+
3+
on:
4+
# Runs when manually triggered from the GitHub UI.
5+
workflow_dispatch:
6+
7+
# Runs when invoked by another workflow.
8+
workflow_call:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
release_prepare:
15+
name: Release prepare
16+
runs-on: ubuntu-latest
17+
outputs:
18+
version_number: ${{ steps.release_prepare.outputs.version_number }}
19+
tag_name: ${{ steps.release_prepare.outputs.tag_name }}
20+
changelog: ${{ steps.release_prepare.outputs.changelog }}
21+
steps:
22+
- uses: apify/workflows/git-cliff-release@main
23+
id: release_prepare
24+
name: Release prepare
25+
with:
26+
release_type: prerelease
27+
existing_changelog_path: CHANGELOG.md
28+
29+
changelog_update:
30+
name: Changelog update
31+
needs: [release_prepare]
32+
permissions:
33+
contents: write
34+
uses: apify/workflows/.github/workflows/python_bump_and_update_changelog.yaml@main
35+
with:
36+
version_number: ${{ needs.release_prepare.outputs.version_number }}
37+
changelog: ${{ needs.release_prepare.outputs.changelog }}
38+
secrets: inherit
39+
40+
pypi_publish:
41+
name: PyPI publish
42+
needs: [release_prepare, changelog_update]
43+
runs-on: ubuntu-latest
44+
permissions:
45+
contents: write
46+
id-token: write # Required for OIDC authentication.
47+
environment:
48+
name: pypi
49+
url: https://pypi.org/project/apify-shared
50+
steps:
51+
- name: Prepare distribution
52+
uses: apify/workflows/prepare-pypi-distribution@main
53+
with:
54+
package_name: apify-shared
55+
is_prerelease: "yes"
56+
version_number: ${{ needs.release_prepare.outputs.version_number }}
57+
ref: ${{ needs.changelog_update.outputs.changelog_commitish }}
58+
59+
# Publish the package to PyPI using PyPA official GitHub action with OIDC authentication.
60+
- name: Publish package to PyPI
61+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/on_master.yaml

Lines changed: 5 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -22,51 +22,13 @@ jobs:
2222
name: Tests
2323
uses: ./.github/workflows/_tests.yaml
2424

25-
release_prepare:
25+
beta_release:
2626
# Skip this for "ci", "docs" and "test" commits and for forks.
2727
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/')"
28-
name: Release prepare
28+
name: Beta release
2929
needs: [code_checks, tests]
30-
runs-on: ubuntu-latest
31-
outputs:
32-
version_number: ${{ steps.release_prepare.outputs.version_number }}
33-
tag_name: ${{ steps.release_prepare.outputs.tag_name }}
34-
changelog: ${{ steps.release_prepare.outputs.changelog }}
35-
steps:
36-
- uses: apify/workflows/git-cliff-release@main
37-
id: release_prepare
38-
name: Release prepare
39-
with:
40-
release_type: prerelease
41-
existing_changelog_path: CHANGELOG.md
42-
43-
changelog_update:
44-
name: Changelog update
45-
needs: [release_prepare]
46-
uses: apify/workflows/.github/workflows/python_bump_and_update_changelog.yaml@main
47-
with:
48-
version_number: ${{ needs.release_prepare.outputs.version_number }}
49-
changelog: ${{ needs.release_prepare.outputs.changelog }}
50-
secrets: inherit
51-
52-
pypi_publish:
53-
name: PyPI publish
54-
needs: [release_prepare, changelog_update]
55-
runs-on: ubuntu-latest
5630
permissions:
5731
contents: write
58-
id-token: write # Required for OIDC authentication.
59-
environment:
60-
name: pypi
61-
url: https://pypi.org/project/apify-shared
62-
steps:
63-
- name: Prepare distribution
64-
uses: apify/workflows/prepare-pypi-distribution@main
65-
with:
66-
package_name: apify-shared
67-
is_prerelease: "yes"
68-
version_number: ${{ needs.release_prepare.outputs.version_number }}
69-
ref: ${{ needs.changelog_update.outputs.changelog_commitish }}
70-
71-
- name: Publish package to PyPI
72-
uses: pypa/gh-action-pypi-publish@release/v1
32+
id-token: write
33+
uses: ./.github/workflows/manual_release_beta.yaml
34+
secrets: inherit

0 commit comments

Comments
 (0)