Skip to content

Commit 9ec381e

Browse files
committed
ci: add manually triggerable beta release workflow
Extract the beta release pipeline into a new reusable workflow that can be invoked both manually from the GitHub UI and from on_master.
1 parent 6b78f38 commit 9ec381e

2 files changed

Lines changed: 78 additions & 56 deletions

File tree

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
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/crawlee
50+
steps:
51+
- name: Prepare distribution
52+
uses: apify/workflows/prepare-pypi-distribution@main
53+
with:
54+
package_name: crawlee
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
62+
63+
doc_release_post_publish:
64+
name: Doc release post publish
65+
needs: [changelog_update, pypi_publish]
66+
permissions:
67+
contents: write
68+
pages: write
69+
id-token: write
70+
uses: ./.github/workflows/manual_release_docs.yaml
71+
with:
72+
# Use the ref from the changelog update to include the updated changelog.
73+
ref: ${{ needs.changelog_update.outputs.changelog_commitish }}
74+
secrets: inherit

.github/workflows/on_master.yaml

Lines changed: 4 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -45,71 +45,19 @@ jobs:
4545
uses: ./.github/workflows/_tests.yaml
4646
secrets: inherit
4747

48-
release_prepare:
48+
beta_release:
4949
# Run this only for "feat", "fix", "perf", "refactor" and "style" commits.
5050
if: >-
5151
startsWith(github.event.head_commit.message, 'feat') ||
5252
startsWith(github.event.head_commit.message, 'fix') ||
5353
startsWith(github.event.head_commit.message, 'perf') ||
5454
startsWith(github.event.head_commit.message, 'refactor') ||
5555
startsWith(github.event.head_commit.message, 'style')
56-
name: Release prepare
56+
name: Beta release
5757
needs: [code_checks, tests]
58-
runs-on: ubuntu-latest
59-
outputs:
60-
version_number: ${{ steps.release_prepare.outputs.version_number }}
61-
tag_name: ${{ steps.release_prepare.outputs.tag_name }}
62-
changelog: ${{ steps.release_prepare.outputs.changelog }}
63-
steps:
64-
- uses: apify/workflows/git-cliff-release@main
65-
id: release_prepare
66-
name: Release prepare
67-
with:
68-
release_type: prerelease
69-
existing_changelog_path: CHANGELOG.md
70-
71-
changelog_update:
72-
name: Changelog update
73-
needs: [release_prepare]
74-
permissions:
75-
contents: write
76-
uses: apify/workflows/.github/workflows/python_bump_and_update_changelog.yaml@main
77-
with:
78-
version_number: ${{ needs.release_prepare.outputs.version_number }}
79-
changelog: ${{ needs.release_prepare.outputs.changelog }}
80-
secrets: inherit
81-
82-
pypi_publish:
83-
name: PyPI publish
84-
needs: [release_prepare, changelog_update]
85-
runs-on: ubuntu-latest
86-
permissions:
87-
contents: write
88-
id-token: write # Required for OIDC authentication.
89-
environment:
90-
name: pypi
91-
url: https://pypi.org/project/crawlee
92-
steps:
93-
- name: Prepare distribution
94-
uses: apify/workflows/prepare-pypi-distribution@main
95-
with:
96-
package_name: crawlee
97-
is_prerelease: "yes"
98-
version_number: ${{ needs.release_prepare.outputs.version_number }}
99-
ref: ${{ needs.changelog_update.outputs.changelog_commitish }}
100-
101-
- name: Publish package to PyPI
102-
uses: pypa/gh-action-pypi-publish@release/v1
103-
104-
doc_release_post_publish:
105-
name: Doc release post publish
106-
needs: [changelog_update, pypi_publish]
10758
permissions:
10859
contents: write
109-
pages: write
11060
id-token: write
111-
uses: ./.github/workflows/manual_release_docs.yaml
112-
with:
113-
# Use the ref from the changelog update to include the updated changelog.
114-
ref: ${{ needs.changelog_update.outputs.changelog_commitish }}
61+
pages: write
62+
uses: ./.github/workflows/manual_release_beta.yaml
11563
secrets: inherit

0 commit comments

Comments
 (0)