Skip to content

Commit 2c80032

Browse files
committed
Update
1 parent c742c44 commit 2c80032

File tree

6 files changed

+100
-110
lines changed

6 files changed

+100
-110
lines changed

.github/workflows/_check_docs.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ jobs:
1111
doc_checks:
1212
name: Doc checks
1313
uses: apify/workflows/.github/workflows/python_docs_check.yaml@main
14-
secrets: inherit

.github/workflows/_release_docs.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414
env:
1515
NODE_VERSION: 22
1616
PYTHON_VERSION: 3.14
17+
CHECKOUT_REF: ${{ github.event_name == 'workflow_call' && inputs.ref || github.ref }}
1718

1819
jobs:
1920
release_docs:
@@ -31,7 +32,7 @@ jobs:
3132
uses: actions/checkout@v6
3233
with:
3334
token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
34-
ref: ${{ github.event_name == 'workflow_call' && inputs.ref || github.ref }}
35+
ref: ${{ env.CHECKOUT_REF }}
3536

3637
- name: Set up Node
3738
uses: actions/setup-node@v6

.github/workflows/_release_pre.yaml

Lines changed: 0 additions & 67 deletions
This file was deleted.

.github/workflows/manual_release_stable.yaml

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -30,52 +30,51 @@ jobs:
3030
name: Code checks
3131
uses: ./.github/workflows/_check_code.yaml
3232

33-
release_metadata:
34-
name: Prepare release metadata
33+
release_prepare:
34+
name: Release prepare
3535
needs: [code_checks]
3636
runs-on: ubuntu-latest
3737
outputs:
38-
version_number: ${{ steps.release_metadata.outputs.version_number }}
39-
tag_name: ${{ steps.release_metadata.outputs.tag_name }}
40-
changelog: ${{ steps.release_metadata.outputs.changelog }}
41-
release_notes: ${{ steps.release_metadata.outputs.release_notes }}
38+
version_number: ${{ steps.release_prepare.outputs.version_number }}
39+
tag_name: ${{ steps.release_prepare.outputs.tag_name }}
40+
changelog: ${{ steps.release_prepare.outputs.changelog }}
41+
release_notes: ${{ steps.release_prepare.outputs.release_notes }}
4242
steps:
4343
- uses: apify/workflows/git-cliff-release@main
44-
name: Prepare release metadata
45-
id: release_metadata
44+
name: Release prepare
45+
id: release_prepare
4646
with:
4747
release_type: ${{ inputs.release_type }}
4848
custom_version: ${{ inputs.custom_version }}
4949
existing_changelog_path: CHANGELOG.md
5050

51-
update_changelog:
52-
name: Update changelog
53-
needs: [release_metadata]
51+
changelog_update:
52+
name: Changelog update
53+
needs: [release_prepare]
5454
uses: apify/workflows/.github/workflows/python_bump_and_update_changelog.yaml@main
5555
with:
56-
version_number: ${{ needs.release_metadata.outputs.version_number }}
57-
changelog: ${{ needs.release_metadata.outputs.changelog }}
58-
secrets:
59-
APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
56+
version_number: ${{ needs.release_prepare.outputs.version_number }}
57+
changelog: ${{ needs.release_prepare.outputs.changelog }}
58+
secrets: inherit
6059

61-
create_github_release:
62-
name: Create GitHub release
63-
needs: [release_metadata, update_changelog]
60+
github_release:
61+
name: GitHub release
62+
needs: [release_prepare, changelog_update]
6463
runs-on: ubuntu-latest
6564
env:
6665
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6766
steps:
68-
- name: Create release
67+
- name: GitHub release
6968
uses: softprops/action-gh-release@v2
7069
with:
71-
tag_name: ${{ needs.release_metadata.outputs.tag_name }}
72-
name: ${{ needs.release_metadata.outputs.version_number }}
73-
target_commitish: ${{ needs.update_changelog.outputs.changelog_commitish }}
74-
body: ${{ needs.release_metadata.outputs.release_notes }}
70+
tag_name: ${{ needs.release_prepare.outputs.tag_name }}
71+
name: ${{ needs.release_prepare.outputs.version_number }}
72+
target_commitish: ${{ needs.changelog_update.outputs.changelog_commitish }}
73+
body: ${{ needs.release_prepare.outputs.release_notes }}
7574

76-
publish_to_pypi:
77-
name: Publish to PyPI
78-
needs: [release_metadata, update_changelog]
75+
pypi_publish:
76+
name: PyPI publish
77+
needs: [release_prepare, changelog_update]
7978
runs-on: ubuntu-latest
8079
permissions:
8180
contents: write
@@ -89,8 +88,8 @@ jobs:
8988
with:
9089
package_name: apify-client
9190
is_prerelease: ""
92-
version_number: ${{ needs.release_metadata.outputs.version_number }}
93-
ref: ${{ needs.update_changelog.outputs.changelog_commitish }}
91+
version_number: ${{ needs.release_prepare.outputs.version_number }}
92+
ref: ${{ needs.changelog_update.outputs.changelog_commitish }}
9493

9594
# Publishes the package to PyPI using PyPA official GitHub action with OIDC authentication.
9695
- name: Publish package to PyPI

.github/workflows/on_master.yaml

Lines changed: 69 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,30 @@
11
name: CI (master)
22

33
on:
4-
# Runs on every push to the master branch.
54
push:
65
branches:
76
- master
87
tags-ignore:
9-
- "**" # Ignore all tags to avoid duplicate executions triggered by tag pushes.
8+
- "**" # Ignore all tags to avoid duplicate executions triggered by tag pushes.
9+
10+
concurrency:
11+
group: release
12+
cancel-in-progress: false
1013

1114
jobs:
1215
doc_checks:
1316
name: Doc checks
1417
uses: ./.github/workflows/_check_docs.yaml
18+
19+
doc_release:
20+
# Skip this for non-docs commits and forks.
21+
if: "startsWith(github.event.head_commit.message, 'docs') && startsWith(github.repository, 'apify/')"
22+
name: Doc release
23+
needs: [doc_checks]
24+
uses: ./.github/workflows/_release_docs.yaml
25+
with:
26+
# Use the same ref as the one that triggered the workflow.
27+
ref: ${{ github.ref }}
1528
secrets: inherit
1629

1730
code_checks:
@@ -23,20 +36,66 @@ jobs:
2336
uses: ./.github/workflows/_check_docstrings.yaml
2437

2538
tests:
39+
# Skip this for "ci" and "docs" commits.
40+
if: "!startsWith(github.event.head_commit.message, 'ci') && !startsWith(github.event.head_commit.message, 'docs')"
2641
name: Tests
2742
uses: ./.github/workflows/_tests.yaml
2843
secrets: inherit
2944

30-
pre_release:
31-
name: Pre-release
32-
needs: [code_checks, tests]
33-
uses: ./.github/workflows/_release_pre.yaml
45+
release_prepare:
46+
# Skip this for "ci", "docs" and "test" commits and for forks.
47+
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/')"
48+
name: Release prepare
49+
needs: [code_checks, docstrings_checks, tests]
50+
runs-on: ubuntu-latest
51+
outputs:
52+
version_number: ${{ steps.release_prepare.outputs.version_number }}
53+
tag_name: ${{ steps.release_prepare.outputs.tag_name }}
54+
changelog: ${{ steps.release_prepare.outputs.changelog }}
55+
steps:
56+
- uses: apify/workflows/git-cliff-release@main
57+
id: release_prepare
58+
name: Release prepare
59+
with:
60+
release_type: prerelease
61+
existing_changelog_path: CHANGELOG.md
62+
63+
changelog_update:
64+
name: Changelog update
65+
needs: [release_prepare]
66+
uses: apify/workflows/.github/workflows/python_bump_and_update_changelog.yaml@main
67+
with:
68+
version_number: ${{ needs.release_prepare.outputs.version_number }}
69+
changelog: ${{ needs.release_prepare.outputs.changelog }}
3470
secrets: inherit
3571

36-
release_docs:
37-
name: Doc release
38-
needs: [doc_checks, pre_release]
72+
pypi_publish:
73+
name: PyPI publish
74+
needs: [release_prepare, changelog_update]
75+
runs-on: ubuntu-latest
76+
permissions:
77+
contents: write
78+
id-token: write # Required for OIDC authentication.
79+
environment:
80+
name: pypi
81+
url: https://pypi.org/project/apify-client
82+
steps:
83+
- name: Prepare distribution
84+
uses: apify/workflows/prepare-pypi-distribution@main
85+
with:
86+
package_name: apify-client
87+
is_prerelease: "yes"
88+
version_number: ${{ needs.release_prepare.outputs.version_number }}
89+
ref: ${{ needs.changelog_update.outputs.changelog_commitish }}
90+
91+
- name: Publish package to PyPI
92+
uses: pypa/gh-action-pypi-publish@release/v1
93+
94+
doc_release_post_publish:
95+
name: Doc release post publish
96+
needs: [changelog_update, pypi_publish]
3997
uses: ./.github/workflows/_release_docs.yaml
4098
with:
41-
ref: ${{ needs.pre_release.outputs.changelog_commitish }}
99+
# Use the ref from the changelog update to include the updated changelog.
100+
ref: ${{ needs.changelog_update.outputs.changelog_commitish }}
42101
secrets: inherit

.github/workflows/on_pull_request.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ on:
55
pull_request:
66

77
jobs:
8-
check_pr_title:
9-
name: Check PR title
8+
pr_title_check:
9+
name: PR title check
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: amannn/[email protected]
@@ -16,7 +16,6 @@ jobs:
1616
doc_checks:
1717
name: Doc checks
1818
uses: ./.github/workflows/_check_docs.yaml
19-
secrets: inherit
2019

2120
code_checks:
2221
name: Code checks

0 commit comments

Comments
 (0)