Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 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
14 changes: 0 additions & 14 deletions .github/workflows/check_pr_title.yaml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/code_checks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Run 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/[email protected]

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/doc_checks.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,19 +1,23 @@
name: Build and deploy docs
name: Docs

on:
# 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: 20
NODE_VERSION: 22
PYTHON_VERSION: 3.14

jobs:
build_and_deploy_docs:
name: Build and deploy docs
environment:
name: github-pages
permissions:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Update new issue

on:
# Runs when a new issue is opened.
issues:
types:
- opened
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/doc_checks.yaml
secrets: inherit

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

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

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

build_and_deploy_docs:
name: Build and deploy docs
needs: [doc_checks, pre_release]
uses: ./.github/workflows/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/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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

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

tests:
name: Tests
uses: ./.github/workflows/tests.yaml
secrets: inherit
40 changes: 11 additions & 29 deletions .github/workflows/pre_release.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
name: Create a 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

jobs:
release_metadata:
if: "!startsWith(github.event.head_commit.message, 'docs') && !startsWith(github.event.head_commit.message, 'ci') && startsWith(github.repository, 'apify/')"
name: Prepare release metadata
runs-on: ubuntu-latest
outputs:
Expand All @@ -31,36 +32,16 @@ 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
runs-on: ubuntu-latest
steps:
- uses: lewagon/[email protected]
with:
ref: ${{ github.ref }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
check-regexp: "( check| tests)$"
wait-interval: 5

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 }}
changelog: ${{ needs.release_metadata.outputs.changelog }}
secrets:
APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}

build_and_deploy_docs:
needs: [update_changelog]
uses: ./.github/workflows/build_and_deploy_docs.yaml
with:
ref: ${{ needs.update_changelog.outputs.changelog_commitish }}
secrets: inherit

publish_to_pypi:
if: "!startsWith(github.event.head_commit.message, 'ci') && !startsWith(github.event.head_commit.message, 'docs')"
name: Publish to PyPI
Expand All @@ -80,6 +61,7 @@ jobs:
is_prerelease: "yes"
version_number: ${{ needs.release_metadata.outputs.version_number }}
ref: ${{ needs.update_changelog.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
Expand Down
38 changes: 16 additions & 22 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Create a 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,21 @@ concurrency:
cancel-in-progress: false

jobs:
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"]'

release_metadata:
name: Prepare release metadata
needs: [lint_check, type_check]
runs-on: ubuntu-latest
outputs:
version_number: ${{ steps.release_metadata.outputs.version_number }}
Expand All @@ -43,37 +56,18 @@ 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 }}
changelog: ${{ needs.release_metadata.outputs.changelog }}
secrets:
APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}

build_and_deploy_docs:
needs: [update_changelog]
uses: ./.github/workflows/build_and_deploy_docs.yaml
with:
ref: ${{ needs.update_changelog.outputs.changelog_commitish }}
secrets: inherit

create_github_release:
name: Create github release
name: Create GitHub release
needs: [release_metadata, update_changelog]
runs-on: ubuntu-latest
env:
Expand Down
56 changes: 0 additions & 56 deletions .github/workflows/run_code_checks.yaml

This file was deleted.

3 changes: 3 additions & 0 deletions .github/workflows/templates_e2e_tests.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: Templates end-to-end tests

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

# Runs on a daily schedule at 06:00 UTC.
schedule:
- cron: '0 6 * * *'

Expand Down
Loading
Loading