|
1 | 1 | name: CI (master) |
2 | 2 |
|
3 | 3 | on: |
4 | | - # Runs on every push to the master branch. |
5 | 4 | push: |
6 | 5 | branches: |
7 | 6 | - master |
8 | 7 | 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 |
10 | 13 |
|
11 | 14 | jobs: |
12 | 15 | doc_checks: |
13 | 16 | name: Doc checks |
14 | 17 | uses: ./.github/workflows/_check_docs.yaml |
15 | | - secrets: inherit |
| 18 | + secrets: |
| 19 | + APIFY_SIGNING_TOKEN: ${{ secrets.APIFY_SIGNING_TOKEN }} |
| 20 | + |
| 21 | + doc_release: |
| 22 | + # Skip this for non-docs commits and forks. |
| 23 | + if: "startsWith(github.event.head_commit.message, 'docs') && startsWith(github.repository, 'apify/')" |
| 24 | + name: Doc release |
| 25 | + needs: [doc_checks] |
| 26 | + uses: ./.github/workflows/_release_docs.yaml |
| 27 | + with: |
| 28 | + # Use the same ref as the one that triggered the workflow. |
| 29 | + ref: ${{ github.ref }} |
| 30 | + secrets: |
| 31 | + APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} |
| 32 | + APIFY_SIGNING_TOKEN: ${{ secrets.APIFY_SIGNING_TOKEN }} |
| 33 | + SEGMENT_TOKEN: ${{ secrets.SEGMENT_TOKEN }} |
16 | 34 |
|
17 | 35 | code_checks: |
18 | 36 | name: Code checks |
19 | 37 | uses: ./.github/workflows/_check_code.yaml |
20 | 38 |
|
21 | 39 | tests: |
| 40 | + # Skip this for "ci" and "docs" commits. |
| 41 | + if: "!startsWith(github.event.head_commit.message, 'ci') && !startsWith(github.event.head_commit.message, 'docs')" |
22 | 42 | name: Tests |
23 | 43 | uses: ./.github/workflows/_tests.yaml |
24 | | - secrets: inherit |
| 44 | + secrets: |
| 45 | + APIFY_HTTPBIN_TOKEN: ${{ secrets.APIFY_HTTPBIN_TOKEN }} |
| 46 | + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
25 | 47 |
|
26 | | - pre_release: |
27 | | - name: Pre-release |
| 48 | + release_prepare: |
| 49 | + # Skip this for "ci", "docs" and "test" commits and for forks. |
| 50 | + 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/')" |
| 51 | + name: Release prepare |
28 | 52 | needs: [code_checks, tests] |
29 | | - uses: ./.github/workflows/_release_pre.yaml |
30 | | - secrets: inherit |
| 53 | + runs-on: ubuntu-latest |
| 54 | + outputs: |
| 55 | + version_number: ${{ steps.release_prepare.outputs.version_number }} |
| 56 | + tag_name: ${{ steps.release_prepare.outputs.tag_name }} |
| 57 | + changelog: ${{ steps.release_prepare.outputs.changelog }} |
| 58 | + steps: |
| 59 | + - uses: apify/workflows/git-cliff-release@main |
| 60 | + id: release_prepare |
| 61 | + name: Release prepare |
| 62 | + with: |
| 63 | + release_type: prerelease |
| 64 | + existing_changelog_path: CHANGELOG.md |
31 | 65 |
|
32 | | - release_docs: |
33 | | - name: Doc release |
34 | | - needs: [doc_checks, pre_release] |
| 66 | + changelog_update: |
| 67 | + name: Changelog update |
| 68 | + needs: [release_prepare] |
| 69 | + uses: apify/workflows/.github/workflows/python_bump_and_update_changelog.yaml@main |
| 70 | + with: |
| 71 | + version_number: ${{ needs.release_prepare.outputs.version_number }} |
| 72 | + changelog: ${{ needs.release_prepare.outputs.changelog }} |
| 73 | + secrets: |
| 74 | + APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} |
| 75 | + |
| 76 | + pypi_publish: |
| 77 | + name: PyPI publish |
| 78 | + needs: [release_prepare, changelog_update] |
| 79 | + runs-on: ubuntu-latest |
| 80 | + permissions: |
| 81 | + contents: write |
| 82 | + id-token: write # Required for OIDC authentication. |
| 83 | + environment: |
| 84 | + name: pypi |
| 85 | + url: https://pypi.org/project/crawlee |
| 86 | + steps: |
| 87 | + - name: Prepare distribution |
| 88 | + uses: apify/workflows/prepare-pypi-distribution@main |
| 89 | + with: |
| 90 | + package_name: crawlee |
| 91 | + is_prerelease: "yes" |
| 92 | + version_number: ${{ needs.release_prepare.outputs.version_number }} |
| 93 | + ref: ${{ needs.changelog_update.outputs.changelog_commitish }} |
| 94 | + |
| 95 | + - name: Publish package to PyPI |
| 96 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 97 | + |
| 98 | + doc_release_post_publish: |
| 99 | + name: Doc release post publish |
| 100 | + needs: [changelog_update, pypi_publish] |
35 | 101 | uses: ./.github/workflows/_release_docs.yaml |
36 | 102 | with: |
37 | | - ref: ${{ needs.pre_release.outputs.changelog_commitish }} |
38 | | - secrets: inherit |
| 103 | + # Use the ref from the changelog update to include the updated changelog. |
| 104 | + ref: ${{ needs.changelog_update.outputs.changelog_commitish }} |
| 105 | + secrets: |
| 106 | + APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} |
| 107 | + APIFY_SIGNING_TOKEN: ${{ secrets.APIFY_SIGNING_TOKEN }} |
| 108 | + SEGMENT_TOKEN: ${{ secrets.SEGMENT_TOKEN }} |
0 commit comments