Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/_check_code.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Code checks

on:
# Runs when manually triggered from the GitHub UI.
workflow_dispatch:

# Runs when invoked by another workflow.
workflow_call:

jobs:
actions_lint_check:
name: Actions lint check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Run actionlint
uses: rhysd/actionlint@v1.7.9

lint_check:
name: Lint check
uses: apify/workflows/.github/workflows/python_lint_check.yaml@main
with:
python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'

type_check:
name: Type check
uses: apify/workflows/.github/workflows/python_type_check.yaml@main
with:
python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'
14 changes: 14 additions & 0 deletions .github/workflows/_check_docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Doc checks

on:
# Runs when manually triggered from the GitHub UI.
workflow_dispatch:

# Runs when invoked by another workflow.
workflow_call:

jobs:
doc_checks:
name: Doc checks
uses: apify/workflows/.github/workflows/python_docs_check.yaml@main
secrets: inherit
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
name: Build and deploy docs
name: Doc release

on:
push:
branches:
- master
# Runs when manually triggered from the GitHub UI.
workflow_dispatch:

# Runs when invoked by another workflow.
workflow_call:
inputs:
ref:
required: true
type: string

env:
NODE_VERSION: 22
PYTHON_VERSION: 3.14

jobs:
build_and_deploy_docs:
release_docs:
name: Doc release
environment:
name: github-pages
permissions:
Expand All @@ -25,29 +31,12 @@ jobs:
uses: actions/checkout@v6
with:
token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
ref: ${{ github.event_name == 'workflow_call' && inputs.ref || github.ref }}

- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
cache-dependency-path: website/package-lock.json

- name: Install Node dependencies
run: |
npm install
npm update @apify/docs-theme
working-directory: ./website

# We do this as early as possible to prevent conflicts if someone else would push something in the meantime
- name: Commit the updated package.json and lockfile
run: |
git config user.name 'GitHub Actions'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git add website/package.json
git add website/package-lock.json
git diff-index --quiet HEAD || git commit -m 'chore: Automatic docs theme update [skip ci]' || true
git push

- name: Set up Python
uses: actions/setup-python@v6
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: Create a pre-release
name: Pre-release

on:
# Trigger a beta version release (pre-release) on push to the master branch.
push:
branches:
- master
tags-ignore:
- "**" # Ignore all tags to prevent duplicate builds when tags are pushed.

# Or it can be triggered manually.
# Runs when manually triggered from the GitHub UI.
workflow_dispatch:

# Runs when invoked by another workflow.
workflow_call:
outputs:
changelog_commitish:
description: The commit SHA after updating the changelog
value: ${{ jobs.update_changelog.outputs.changelog_commitish }}

concurrency:
group: release
cancel-in-progress: false
Expand All @@ -32,18 +32,9 @@ jobs:
release_type: prerelease
existing_changelog_path: CHANGELOG.md

# If github.ref points to a [ci skip] commit, this workflow won't run.
# Otherwise, these checks will be launched from the `run_code_checks` workflow.
wait_for_checks:
name: Wait for code checks to pass
uses: apify/workflows/.github/workflows/wait_for_checks.yaml@wait-for-checks-action
with:
ref: ${{ github.ref }}
check-regexp: "( check| tests)$"

update_changelog:
name: Update changelog
needs: [release_metadata, wait_for_checks]
needs: [release_metadata]
uses: apify/workflows/.github/workflows/python_bump_and_update_changelog.yaml@main
with:
version_number: ${{ needs.release_metadata.outputs.version_number }}
Expand All @@ -52,8 +43,9 @@ jobs:
APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}

publish_to_pypi:
if: "!startsWith(github.event.head_commit.message, 'ci') && !startsWith(github.event.head_commit.message, 'docs')"
name: Publish to PyPI
needs: [release_metadata, wait_for_checks, update_changelog]
needs: [release_metadata, update_changelog]
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -72,3 +64,6 @@ jobs:
# Publishes the package to PyPI using PyPA official GitHub action with OIDC authentication.
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

# TODO: add job for publish package to Conda
# https://github.com/apify/crawlee-python/issues/104
29 changes: 29 additions & 0 deletions .github/workflows/_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Tests

on:
# Runs when manually triggered from the GitHub UI.
workflow_dispatch:

# Runs when invoked by another workflow.
workflow_call:

jobs:
unit_tests:
name: Unit tests
uses: apify/workflows/.github/workflows/python_unit_tests.yaml@main
secrets: inherit
with:
python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'
operating-systems: '["ubuntu-latest", "windows-latest"]'
python-version-for-codecov: "3.14"
operating-system-for-codecov: ubuntu-latest

integration_tests:
name: Integration tests
uses: apify/workflows/.github/workflows/python_integration_tests.yaml@main
secrets: inherit
with:
python-versions: '["3.10", "3.14"]'
operating-systems: '["ubuntu-latest"]'
python-version-for-codecov: "3.14"
operating-system-for-codecov: ubuntu-latest
14 changes: 0 additions & 14 deletions .github/workflows/check_pr_title.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Create a release
name: Stable release

on:
# Trigger a stable version release via GitHub's UI, with the ability to specify the type of release.
# Runs when manually triggered from the GitHub UI, with options to specify the type of release.
workflow_dispatch:
inputs:
release_type:
Expand All @@ -26,8 +26,13 @@ concurrency:
cancel-in-progress: false

jobs:
code_checks:
name: Code checks
uses: ./.github/workflows/_check_code.yaml

release_metadata:
name: Prepare release metadata
needs: [code_checks]
runs-on: ubuntu-latest
outputs:
version_number: ${{ steps.release_metadata.outputs.version_number }}
Expand All @@ -43,21 +48,9 @@ jobs:
custom_version: ${{ inputs.custom_version }}
existing_changelog_path: CHANGELOG.md

lint_check:
name: Lint check
uses: apify/workflows/.github/workflows/python_lint_check.yaml@main
with:
python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'

type_check:
name: Type check
uses: apify/workflows/.github/workflows/python_type_check.yaml@main
with:
python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'

update_changelog:
name: Update changelog
needs: [release_metadata, lint_check, type_check]
needs: [release_metadata]
uses: apify/workflows/.github/workflows/python_bump_and_update_changelog.yaml@main
with:
version_number: ${{ needs.release_metadata.outputs.version_number }}
Expand All @@ -66,7 +59,7 @@ jobs:
APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}

create_github_release:
name: Create github release
name: Create GitHub release
needs: [release_metadata, update_changelog]
runs-on: ubuntu-latest
env:
Expand Down Expand Up @@ -102,6 +95,9 @@ jobs:
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

# TODO: add job for publish package to Conda
# https://github.com/apify/crawlee-python/issues/104

trigger_docker_build:
name: Trigger Docker image build
needs: [release_metadata, update_changelog]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
name: Update new issue
name: CI (issue)

on:
# Runs when a new issue is opened.
issues:
types:
- opened

jobs:
label_issues:
name: Label issues
name: Add labels
runs-on: ubuntu-latest
permissions:
issues: write
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/on_master.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI (master)

on:
# Runs on every push to the master branch.
push:
branches:
- master
tags-ignore:
- "**" # Ignore all tags to avoid duplicate executions triggered by tag pushes.

jobs:
doc_checks:
name: Doc checks
uses: ./.github/workflows/_check_docs.yaml
secrets: inherit

code_checks:
name: Code checks
uses: ./.github/workflows/_check_code.yaml

tests:
name: Tests
uses: ./.github/workflows/_tests.yaml
secrets: inherit

pre_release:
name: Pre-release
needs: [code_checks, tests]
uses: ./.github/workflows/_release_pre.yaml
secrets: inherit

release_docs:
name: Doc release
needs: [doc_checks, pre_release]
uses: ./.github/workflows/_release_docs.yaml
with:
ref: ${{ needs.pre_release.outputs.changelog_commitish }}
secrets: inherit
28 changes: 28 additions & 0 deletions .github/workflows/on_pull_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CI (PR)

on:
# Runs whenever a pull request is opened or updated.
pull_request:

jobs:
check_pr_title:
name: Check PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v6.1.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

doc_checks:
name: Doc checks
uses: ./.github/workflows/_check_docs.yaml
secrets: inherit

code_checks:
name: Code checks
uses: ./.github/workflows/_check_code.yaml

tests:
name: Tests
uses: ./.github/workflows/_tests.yaml
secrets: inherit
Loading
Loading