Skip to content

Commit 3b98ff7

Browse files
committed
Update naming
1 parent c312481 commit 3b98ff7

9 files changed

Lines changed: 156 additions & 108 deletions

.github/workflows/_check_code.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Code checks
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+
jobs:
11+
actions_lint_check:
12+
name: Actions lint check
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v6
17+
- name: Run actionlint
18+
uses: rhysd/actionlint@v1.7.9
19+
20+
lint_check:
21+
name: Lint check
22+
uses: apify/workflows/.github/workflows/python_lint_check.yaml@main
23+
with:
24+
python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'
25+
26+
type_check:
27+
name: Type check
28+
uses: apify/workflows/.github/workflows/python_type_check.yaml@main
29+
with:
30+
python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
name: Create a pre-release
1+
name: Pre-release
22

33
on:
4-
# Trigger a beta version release (pre-release) on push to the master branch.
5-
push:
6-
branches:
7-
- master
8-
tags-ignore:
9-
- "**" # Ignore all tags to prevent duplicate builds when tags are pushed.
10-
11-
# Or it can be triggered manually.
4+
# Runs when manually triggered from the GitHub UI.
125
workflow_dispatch:
136

7+
# Runs when invoked by another workflow.
8+
workflow_call:
9+
outputs:
10+
changelog_commitish:
11+
description: The commit SHA after updating the changelog
12+
value: ${{ jobs.update_changelog.outputs.changelog_commitish }}
13+
1414
concurrency:
1515
group: release
1616
cancel-in-progress: false
@@ -24,21 +24,17 @@ jobs:
2424
version_number: ${{ steps.release_metadata.outputs.version_number }}
2525
tag_name: ${{ steps.release_metadata.outputs.tag_name }}
2626
changelog: ${{ steps.release_metadata.outputs.changelog }}
27-
existing_changelog_path: CHANGELOG.md
2827
steps:
2928
- uses: apify/workflows/git-cliff-release@main
3029
id: release_metadata
3130
name: Prepare release metadata
3231
with:
3332
release_type: prerelease
34-
35-
run_code_checks:
36-
name: Run code checks
37-
uses: ./.github/workflows/code_checks.yaml
33+
existing_changelog_path: CHANGELOG.md
3834

3935
update_changelog:
4036
name: Update changelog
41-
needs: [release_metadata, run_code_checks]
37+
needs: [release_metadata]
4238
uses: apify/workflows/.github/workflows/python_bump_and_update_changelog.yaml@main
4339
with:
4440
version_number: ${{ needs.release_metadata.outputs.version_number }}
@@ -47,8 +43,9 @@ jobs:
4743
APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
4844

4945
publish_to_pypi:
46+
if: "!startsWith(github.event.head_commit.message, 'ci') && !startsWith(github.event.head_commit.message, 'docs')"
5047
name: Publish to PyPI
51-
needs: [release_metadata, run_code_checks, update_changelog]
48+
needs: [release_metadata, update_changelog]
5249
runs-on: ubuntu-latest
5350
permissions:
5451
contents: write
@@ -64,6 +61,10 @@ jobs:
6461
is_prerelease: "yes"
6562
version_number: ${{ needs.release_metadata.outputs.version_number }}
6663
ref: ${{ needs.update_changelog.outputs.changelog_commitish }}
64+
6765
# Publishes the package to PyPI using PyPA official GitHub action with OIDC authentication.
6866
- name: Publish package to PyPI
6967
uses: pypa/gh-action-pypi-publish@release/v1
68+
69+
# TODO: add job for publish package to Conda
70+
# https://github.com/apify/crawlee-python/issues/104

.github/workflows/_tests.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Tests
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+
jobs:
11+
# Create a custom unit tests job, because apify-shared-python doesn't use codecov report.
12+
unit_tests:
13+
name: Unit tests
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
os: [ubuntu-latest, windows-latest]
18+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
19+
runs-on: ${{ matrix.os }}
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v6
24+
25+
- name: Set up Python ${{ matrix.python-version }}
26+
uses: actions/setup-python@v6
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
30+
- name: Set up uv package manager
31+
uses: astral-sh/setup-uv@v7
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
35+
- name: Install Python dependencies
36+
run: make install-dev
37+
38+
- name: Run unit tests
39+
run: make unit-tests-cov

.github/workflows/check_pr_title.yaml

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

.github/workflows/code_checks.yaml

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

.github/workflows/release.yaml renamed to .github/workflows/manual_release_stable.yaml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
name: Create a release
1+
name: Stable release
22

33
on:
4-
# Trigger a stable version release via GitHub's UI, with the ability to specify the type of release.
4+
# Runs when manually triggered from the GitHub UI, with options to specify the type of release.
55
workflow_dispatch:
66
inputs:
77
release_type:
@@ -21,9 +21,22 @@ on:
2121
type: string
2222
default: ""
2323

24+
concurrency:
25+
group: release
26+
cancel-in-progress: false
27+
2428
jobs:
29+
code_checks:
30+
name: Code checks
31+
uses: ./.github/workflows/_check_code.yaml
32+
33+
tests:
34+
name: Tests
35+
uses: ./.github/workflows/_tests.yaml
36+
2537
release_metadata:
2638
name: Prepare release metadata
39+
needs: [code_checks, tests]
2740
runs-on: ubuntu-latest
2841
outputs:
2942
version_number: ${{ steps.release_metadata.outputs.version_number }}
@@ -39,13 +52,9 @@ jobs:
3952
custom_version: ${{ inputs.custom_version }}
4053
existing_changelog_path: CHANGELOG.md
4154

42-
run_code_checks:
43-
name: Run code checks
44-
uses: ./.github/workflows/code_checks.yaml
45-
4655
update_changelog:
4756
name: Update changelog
48-
needs: [release_metadata, run_code_checks]
57+
needs: [release_metadata]
4958
uses: apify/workflows/.github/workflows/python_bump_and_update_changelog.yaml@main
5059
with:
5160
version_number: ${{ needs.release_metadata.outputs.version_number }}
@@ -54,7 +63,7 @@ jobs:
5463
APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
5564

5665
create_github_release:
57-
name: Create github release
66+
name: Create GitHub release
5867
needs: [release_metadata, update_changelog]
5968
runs-on: ubuntu-latest
6069
env:
@@ -89,3 +98,6 @@ jobs:
8998
# Publishes the package to PyPI using PyPA official GitHub action with OIDC authentication.
9099
- name: Publish package to PyPI
91100
uses: pypa/gh-action-pypi-publish@release/v1
101+
102+
# TODO: add job for publish package to Conda
103+
# https://github.com/apify/crawlee-python/issues/104
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
name: Update new issue
1+
name: CI (issue)
22

33
on:
4+
# Runs when a new issue is opened.
45
issues:
56
types:
67
- opened
78

89
jobs:
910
label_issues:
10-
name: Label issues
11+
name: Add labels
1112
runs-on: ubuntu-latest
1213
permissions:
1314
issues: write
1415

1516
steps:
1617
# Add the "t-tooling" label to all new issues
17-
- uses: actions/github-script@v7
18+
- uses: actions/github-script@v8
1819
with:
1920
script: |
2021
github.rest.issues.addLabels({

.github/workflows/on_master.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: CI (master)
2+
3+
on:
4+
# Runs on every push to the master branch.
5+
push:
6+
branches:
7+
- master
8+
tags-ignore:
9+
- "**" # Ignore all tags to avoid duplicate executions triggered by tag pushes.
10+
11+
jobs:
12+
code_checks:
13+
name: Code checks
14+
uses: ./.github/workflows/_check_code.yaml
15+
16+
tests:
17+
name: Tests
18+
uses: ./.github/workflows/_tests.yaml
19+
20+
pre_release:
21+
name: Pre-release
22+
needs: [code_checks, tests]
23+
uses: ./.github/workflows/_release_pre.yaml
24+
secrets: inherit
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: CI (PR)
2+
3+
on:
4+
# Runs whenever a pull request is opened or updated.
5+
pull_request:
6+
7+
jobs:
8+
check_pr_title:
9+
name: Check PR title
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: amannn/action-semantic-pull-request@v6.1.1
13+
env:
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
16+
code_checks:
17+
name: Code checks
18+
uses: ./.github/workflows/_check_code.yaml
19+
20+
tests:
21+
name: Tests
22+
uses: ./.github/workflows/_tests.yaml

0 commit comments

Comments
 (0)