Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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"]'
13 changes: 13 additions & 0 deletions .github/workflows/_check_docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
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
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
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
CHECKOUT_REF: ${{ github.event_name == 'workflow_call' && inputs.ref || github.ref }}

jobs:
build_and_deploy_docs:
release_docs:
name: Doc release
environment:
name: github-pages
permissions:
Expand All @@ -25,6 +32,7 @@ jobs:
uses: actions/checkout@v6
with:
token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
ref: ${{ env.CHECKOUT_REF }}

- name: Set up Node
uses: actions/setup-node@v6
Expand Down
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,63 +26,55 @@ concurrency:
cancel-in-progress: false

jobs:
release_metadata:
name: Prepare release metadata
code_checks:
name: Code checks
uses: ./.github/workflows/_check_code.yaml

release_prepare:
name: Release prepare
needs: [code_checks]
runs-on: ubuntu-latest
outputs:
version_number: ${{ steps.release_metadata.outputs.version_number }}
tag_name: ${{ steps.release_metadata.outputs.tag_name }}
changelog: ${{ steps.release_metadata.outputs.changelog }}
release_notes: ${{ steps.release_metadata.outputs.release_notes }}
version_number: ${{ steps.release_prepare.outputs.version_number }}
tag_name: ${{ steps.release_prepare.outputs.tag_name }}
changelog: ${{ steps.release_prepare.outputs.changelog }}
release_notes: ${{ steps.release_prepare.outputs.release_notes }}
steps:
- uses: apify/workflows/git-cliff-release@main
name: Prepare release metadata
id: release_metadata
name: Release prepare
id: release_prepare
with:
release_type: ${{ inputs.release_type }}
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]
changelog_update:
name: Changelog update
needs: [release_prepare]
uses: apify/workflows/.github/workflows/python_bump_and_update_changelog.yaml@main
with:
version_number: ${{ needs.release_metadata.outputs.version_number }}
changelog: ${{ needs.release_metadata.outputs.changelog }}
secrets:
APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
version_number: ${{ needs.release_prepare.outputs.version_number }}
changelog: ${{ needs.release_prepare.outputs.changelog }}
secrets: inherit

create_github_release:
name: Create github release
needs: [release_metadata, update_changelog]
github_release:
name: GitHub release
needs: [release_prepare, changelog_update]
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Create release
- name: GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.release_metadata.outputs.tag_name }}
name: ${{ needs.release_metadata.outputs.version_number }}
target_commitish: ${{ needs.update_changelog.outputs.changelog_commitish }}
body: ${{ needs.release_metadata.outputs.release_notes }}
tag_name: ${{ needs.release_prepare.outputs.tag_name }}
name: ${{ needs.release_prepare.outputs.version_number }}
target_commitish: ${{ needs.changelog_update.outputs.changelog_commitish }}
body: ${{ needs.release_prepare.outputs.release_notes }}

publish_to_pypi:
name: Publish to PyPI
needs: [release_metadata, update_changelog]
pypi_publish:
name: PyPI publish
needs: [release_prepare, changelog_update]
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -96,15 +88,16 @@ jobs:
with:
package_name: apify
is_prerelease: ""
version_number: ${{ needs.release_metadata.outputs.version_number }}
ref: ${{ needs.update_changelog.outputs.changelog_commitish }}
version_number: ${{ needs.release_prepare.outputs.version_number }}
ref: ${{ needs.changelog_update.outputs.changelog_commitish }}

# 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

trigger_docker_build:
name: Trigger Docker image build
needs: [release_metadata, update_changelog]
needs: [release_prepare, changelog_update]
runs-on: ubuntu-latest
steps:
# Trigger building the Python Docker images in apify/apify-actor-docker repo
Expand All @@ -113,6 +106,6 @@ jobs:
gh api -X POST "/repos/apify/apify-actor-docker/dispatches" \
-F event_type=build-python-images \
-F 'client_payload[release_tag]=latest' \
-F 'client_payload[apify_version]=${{ needs.release_metadata.outputs.version_number }}'
-F 'client_payload[apify_version]=${{ needs.release_prepare.outputs.version_number }}'
env:
GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
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
97 changes: 97 additions & 0 deletions .github/workflows/on_master.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: CI (master)

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

concurrency:
group: release
cancel-in-progress: false

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

doc_release:
# Skip this for non-docs commits and forks.
if: "startsWith(github.event.head_commit.message, 'docs') && startsWith(github.repository, 'apify/')"
name: Doc release
needs: [doc_checks]
uses: ./.github/workflows/_release_docs.yaml
with:
# Use the same ref as the one that triggered the workflow.
ref: ${{ github.ref }}
secrets: inherit

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

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

release_prepare:
# Skip this for "ci", "docs" and "test" commits and for forks.
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/')"
name: Release prepare
needs: [code_checks, tests]
runs-on: ubuntu-latest
outputs:
version_number: ${{ steps.release_prepare.outputs.version_number }}
tag_name: ${{ steps.release_prepare.outputs.tag_name }}
changelog: ${{ steps.release_prepare.outputs.changelog }}
steps:
- uses: apify/workflows/git-cliff-release@main
id: release_prepare
name: Release prepare
with:
release_type: prerelease
existing_changelog_path: CHANGELOG.md

changelog_update:
name: Changelog update
needs: [release_prepare]
uses: apify/workflows/.github/workflows/python_bump_and_update_changelog.yaml@main
with:
version_number: ${{ needs.release_prepare.outputs.version_number }}
changelog: ${{ needs.release_prepare.outputs.changelog }}
secrets: inherit

pypi_publish:
name: PyPI publish
needs: [release_prepare, changelog_update]
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write # Required for OIDC authentication.
environment:
name: pypi
url: https://pypi.org/project/apify
steps:
- name: Prepare distribution
uses: apify/workflows/prepare-pypi-distribution@main
with:
package_name: apify
is_prerelease: "yes"
version_number: ${{ needs.release_prepare.outputs.version_number }}
ref: ${{ needs.changelog_update.outputs.changelog_commitish }}

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

doc_release_post_publish:
name: Doc release post publish
needs: [changelog_update, pypi_publish]
uses: ./.github/workflows/_release_docs.yaml
with:
# Use the ref from the changelog update to include the updated changelog.
ref: ${{ needs.changelog_update.outputs.changelog_commitish }}
secrets: inherit
Loading
Loading