-
Notifications
You must be signed in to change notification settings - Fork 16
119 lines (106 loc) · 3.52 KB
/
on_master.yaml
File metadata and controls
119 lines (106 loc) · 3.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
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
permissions:
contents: read
jobs:
doc_checks:
name: Doc checks
uses: ./.github/workflows/_check_docs.yaml
doc_release:
# Skip this for non-"docs" commits.
if: startsWith(github.event.head_commit.message, 'docs')
name: Doc release
needs: [doc_checks]
permissions:
contents: write
pages: write
id-token: write
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
docstrings_checks:
name: Docstrings checks
uses: ./.github/workflows/_check_docstrings.yaml
tests:
# Skip this for "docs" commits.
if: "!startsWith(github.event.head_commit.message, 'docs')"
name: Tests
uses: ./.github/workflows/_tests.yaml
secrets: inherit
release_prepare:
# Run this only for "feat", "fix", "perf", "refactor" and "style" commits.
if: >-
startsWith(github.event.head_commit.message, 'feat') ||
startsWith(github.event.head_commit.message, 'fix') ||
startsWith(github.event.head_commit.message, 'perf') ||
startsWith(github.event.head_commit.message, 'refactor') ||
startsWith(github.event.head_commit.message, 'style')
name: Release prepare
needs: [code_checks, docstrings_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]
permissions:
contents: write
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-client
steps:
- name: Prepare distribution
uses: apify/workflows/prepare-pypi-distribution@main
with:
package_name: apify-client
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]
permissions:
contents: write
pages: write
id-token: write
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