Skip to content

Commit d638d03

Browse files
committed
Update
1 parent 81ce890 commit d638d03

File tree

4 files changed

+82
-102
lines changed

4 files changed

+82
-102
lines changed

.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
@@ -34,52 +34,51 @@ jobs:
3434
name: Tests
3535
uses: ./.github/workflows/_tests.yaml
3636

37-
release_metadata:
38-
name: Prepare release metadata
37+
release_prepare:
38+
name: Release prepare
3939
needs: [code_checks, tests]
4040
runs-on: ubuntu-latest
4141
outputs:
42-
version_number: ${{ steps.release_metadata.outputs.version_number }}
43-
tag_name: ${{ steps.release_metadata.outputs.tag_name }}
44-
changelog: ${{ steps.release_metadata.outputs.changelog }}
45-
release_notes: ${{ steps.release_metadata.outputs.release_notes }}
42+
version_number: ${{ steps.release_prepare.outputs.version_number }}
43+
tag_name: ${{ steps.release_prepare.outputs.tag_name }}
44+
changelog: ${{ steps.release_prepare.outputs.changelog }}
45+
release_notes: ${{ steps.release_prepare.outputs.release_notes }}
4646
steps:
4747
- uses: apify/workflows/git-cliff-release@main
48-
name: Prepare release metadata
49-
id: release_metadata
48+
name: Release prepare
49+
id: release_prepare
5050
with:
5151
release_type: ${{ inputs.release_type }}
5252
custom_version: ${{ inputs.custom_version }}
5353
existing_changelog_path: CHANGELOG.md
5454

55-
update_changelog:
56-
name: Update changelog
57-
needs: [release_metadata]
55+
changelog_update:
56+
name: Changelog update
57+
needs: [release_prepare]
5858
uses: apify/workflows/.github/workflows/python_bump_and_update_changelog.yaml@main
5959
with:
60-
version_number: ${{ needs.release_metadata.outputs.version_number }}
61-
changelog: ${{ needs.release_metadata.outputs.changelog }}
62-
secrets:
63-
APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
60+
version_number: ${{ needs.release_prepare.outputs.version_number }}
61+
changelog: ${{ needs.release_prepare.outputs.changelog }}
62+
secrets: inherit
6463

65-
create_github_release:
66-
name: Create GitHub release
67-
needs: [release_metadata, update_changelog]
64+
github_release:
65+
name: GitHub release
66+
needs: [release_prepare, changelog_update]
6867
runs-on: ubuntu-latest
6968
env:
7069
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7170
steps:
72-
- name: Create release
71+
- name: GitHub release
7372
uses: softprops/action-gh-release@v2
7473
with:
75-
tag_name: ${{ needs.release_metadata.outputs.tag_name }}
76-
name: ${{ needs.release_metadata.outputs.version_number }}
77-
target_commitish: ${{ needs.update_changelog.outputs.changelog_commitish }}
78-
body: ${{ needs.release_metadata.outputs.release_notes }}
74+
tag_name: ${{ needs.release_prepare.outputs.tag_name }}
75+
name: ${{ needs.release_prepare.outputs.version_number }}
76+
target_commitish: ${{ needs.changelog_update.outputs.changelog_commitish }}
77+
body: ${{ needs.release_prepare.outputs.release_notes }}
7978

80-
publish_to_pypi:
81-
name: Publish to PyPI
82-
needs: [release_metadata, update_changelog]
79+
pypi_publish:
80+
name: PyPI publish
81+
needs: [release_prepare, changelog_update]
8382
runs-on: ubuntu-latest
8483
permissions:
8584
contents: write
@@ -93,8 +92,8 @@ jobs:
9392
with:
9493
package_name: apify-shared
9594
is_prerelease: ""
96-
version_number: ${{ needs.release_metadata.outputs.version_number }}
97-
ref: ${{ needs.update_changelog.outputs.changelog_commitish }}
95+
version_number: ${{ needs.release_prepare.outputs.version_number }}
96+
ref: ${{ needs.changelog_update.outputs.changelog_commitish }}
9897

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

.github/workflows/on_master.yaml

Lines changed: 53 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,72 @@
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
code_checks:
1316
name: Code checks
1417
uses: ./.github/workflows/_check_code.yaml
1518

1619
tests:
20+
# Skip this for "ci" and "docs" commits.
21+
if: "!startsWith(github.event.head_commit.message, 'ci') && !startsWith(github.event.head_commit.message, 'docs')"
1722
name: Tests
1823
uses: ./.github/workflows/_tests.yaml
1924

20-
pre_release:
21-
name: Pre-release
25+
release_prepare:
26+
# Skip this for "ci", "docs" and "test" commits and for forks.
27+
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
2229
needs: [code_checks, tests]
23-
uses: ./.github/workflows/_release_pre.yaml
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 }}
2450
secrets: inherit
51+
52+
pypi_publish:
53+
name: PyPI publish
54+
needs: [release_prepare, changelog_update]
55+
runs-on: ubuntu-latest
56+
permissions:
57+
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

.github/workflows/on_pull_request.yaml

Lines changed: 2 additions & 2 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]

0 commit comments

Comments
 (0)