-
Notifications
You must be signed in to change notification settings - Fork 8
117 lines (101 loc) · 2.99 KB
/
release.yml
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
name: Release
run-name: "Continous Release"
on:
workflow_dispatch:
schedule:
- cron: '0 1 * * 3' # this means every Wednesday @1am UTC
permissions:
contents: read
jobs:
rc:
name: Check if we need a new release
runs-on: ubuntu-latest
permissions:
contents: write
issues: read
outputs:
rc: ${{ steps.rc.outputs.new_release_published }}
ver: ${{ steps.rc.outputs.new_release_version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check if new version will be produced
id: rc
uses: cycjimmy/semantic-release-action@v4
with:
dry_run: true
semantic_version: 19.0
extra_plugins: |
conventional-changelog-conventionalcommits@^5.0.0
@semantic-release/git@^10.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
pyversion:
name: Discover minimum Python version
needs: rc
if: needs.rc.outputs.rc == 'true'
uses: ./.github/workflows/_discover_python_ver.yml
code_format:
name: Validate code formatting
needs: pyversion
uses: ./.github/workflows/sub_format.yml
with:
python_version: ${{ needs.pyversion.outputs.pyversion }}
unit_tests:
name: Validate all Unit Tests pass
needs: pyversion
permissions:
contents: write
uses: ./.github/workflows/sub_unittest.yml
with:
python_version: ${{ needs.pyversion.outputs.pyversion }}
documentation_check:
name: Validate that the API documentation is up to date
needs: pyversion
uses: ./.github/workflows/sub_docs.yml
with:
python_version: ${{ needs.pyversion.outputs.pyversion }}
release:
name: Create a new release
runs-on: ubuntu-latest
if: needs.rc.outputs.rc == 'true'
needs:
- rc
- code_format
- unit_tests
- documentation_check
- pyversion
concurrency: release
permissions:
contents: write
issues: read
outputs:
released: ${{ steps.release.outputs.new_release_published }}
tag: ${{ steps.release.outputs.new_release_git_tag }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: ${{ needs.pyversion.outputs.pyversion }}
- name: Install Poetry
uses: Gr1N/setup-poetry@v8
- name: Create Poetry venv
run: |
poetry env use ${{ needs.pyversion.outputs.pyversion }}
- name: Bump package version
env:
VERSION: ${{ needs.rc.outputs.ver }}
run: |
poetry version "${VERSION}"
- name: Create release and publish to GitHub
id: release
uses: cycjimmy/semantic-release-action@v4
with:
semantic_version: 19.0
extra_plugins: |
conventional-changelog-conventionalcommits@^5.0.0
@semantic-release/git@^10.0.1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_PAT }}