@@ -8,8 +8,6 @@ on: # yamllint disable-line rule:truthy rule:comments
88 branches :
99 - " main"
1010 - " develop"
11- tags :
12- - " v*"
1311 pull_request : ~
1412
1513env :
1816
1917jobs :
2018 ruff-format :
21- runs-on : " ubuntu-24.04 "
19+ runs-on : " ubuntu-latest "
2220 env :
2321 INVOKE_JDIFF_LOCAL : " True"
2422 steps :
@@ -27,11 +25,11 @@ jobs:
2725 - name : " Setup environment"
2826 uses : " networktocode/gh-action-setup-poetry-environment@v6"
2927 with :
30- poetry-version : " 1.8.5 "
28+ poetry-version : " 2.1.3 "
3129 - name : " Linting: ruff format"
3230 run : " poetry run invoke ruff --action format"
3331 ruff-lint :
34- runs-on : " ubuntu-24.04 "
32+ runs-on : " ubuntu-latest "
3533 env :
3634 INVOKE_JDIFF_LOCAL : " True"
3735 steps :
@@ -40,11 +38,11 @@ jobs:
4038 - name : " Setup environment"
4139 uses : " networktocode/gh-action-setup-poetry-environment@v6"
4240 with :
43- poetry-version : " 1.8.5 "
41+ poetry-version : " 2.1.3 "
4442 - name : " Linting: ruff"
4543 run : " poetry run invoke ruff --action lint"
4644 check-docs-build :
47- runs-on : " ubuntu-22.04 "
45+ runs-on : " ubuntu-latest "
4846 env :
4947 INVOKE_JDIFF_LOCAL : " True"
5048 steps :
@@ -53,11 +51,12 @@ jobs:
5351 - name : " Setup environment"
5452 uses : " networktocode/gh-action-setup-poetry-environment@v6"
5553 with :
56- poetry-version : " 1.8.5"
54+ poetry-version : " 2.1.3"
55+ poetry-install-options : " --only dev,docs"
5756 - name : " Check Docs Build"
5857 run : " poetry run invoke build-and-check-docs"
5958 poetry :
60- runs-on : " ubuntu-24.04 "
59+ runs-on : " ubuntu-latest "
6160 env :
6261 INVOKE_JDIFF_LOCAL : " True"
6362 steps :
@@ -66,15 +65,11 @@ jobs:
6665 - name : " Setup environment"
6766 uses : " networktocode/gh-action-setup-poetry-environment@v6"
6867 with :
69- poetry-version : " 1.8.5 "
68+ poetry-version : " 2.1.3 "
7069 - name : " Checking: poetry lock file"
71- run : " poetry lock --check"
72- needs :
73- - " ruff-format"
74- - " ruff-lint"
75- - " yamllint"
70+ run : " poetry run invoke lock --check"
7671 yamllint :
77- runs-on : " ubuntu-24.04 "
72+ runs-on : " ubuntu-latest "
7873 env :
7974 INVOKE_JDIFF_LOCAL : " True"
8075 steps :
@@ -83,25 +78,29 @@ jobs:
8378 - name : " Setup environment"
8479 uses : " networktocode/gh-action-setup-poetry-environment@v6"
8580 with :
86- poetry-version : " 1.8.5 "
81+ poetry-version : " 2.1.3 "
8782 - name : " Linting: yamllint"
8883 run : " poetry run invoke yamllint"
84+ check-in-docker :
8985 needs :
9086 - " ruff-format"
9187 - " ruff-lint"
92- pylint :
93- runs-on : " ubuntu-24.04"
88+ - " poetry"
89+ - " yamllint"
90+ runs-on : " ubuntu-latest"
9491 strategy :
9592 fail-fast : true
9693 matrix :
97- python-version : ["3.9", "3.10", "3.11", "3.12 ", "3.13"]
94+ python-version : ["3.10 ", "3.13"]
9895 env :
99- PYTHON_VER : " ${{ matrix.python-version }}"
96+ INVOKE_JDIFF_PYTHON_VER : " ${{ matrix.python-version }}"
10097 steps :
10198 - name : " Check out repository code"
10299 uses : " actions/checkout@v4"
103100 - name : " Setup environment"
104101 uses : " networktocode/gh-action-setup-poetry-environment@v6"
102+ with :
103+ poetry-version : " 2.1.3"
105104 - name : " Get image version"
106105 run : " echo INVOKE_JDIFF_IMAGE_VER=`poetry version -s`-py${{ matrix.python-version }} >> $GITHUB_ENV"
107106 - name : " Set up Docker Buildx"
@@ -119,26 +118,26 @@ jobs:
119118 cache-from : " type=gha,scope=${{ env.INVOKE_JDIFF_IMAGE_NAME }}-${{ env.INVOKE_JDIFF_IMAGE_VER }}-py${{ matrix.python-version }}"
120119 cache-to : " type=gha,scope=${{ env.INVOKE_JDIFF_IMAGE_NAME }}-${{ env.INVOKE_JDIFF_IMAGE_VER }}-py${{ matrix.python-version }}"
121120 build-args : |
122- PYTHON_VER=${{ env.PYTHON_VER }}
123- - name : " Debug: Show docker images"
124- run : " docker image ls"
121+ PYTHON_VER=${{ matrix.python-version }}
125122 - name : " Linting: Pylint"
126123 run : " poetry run invoke pylint"
127- needs :
128- - " poetry"
129124 pytest :
125+ needs :
126+ - " check-in-docker"
130127 strategy :
131128 fail-fast : true
132129 matrix :
133- python-version : ["3.9", "3. 10", "3.11", "3.12", "3.13"]
134- runs-on : " ubuntu-24.04 "
130+ python-version : ["3.10", "3.11", "3.12", "3.13"]
131+ runs-on : " ubuntu-latest "
135132 env :
136- PYTHON_VER : " ${{ matrix.python-version }}"
133+ INVOKE_JDIFF_PYTHON_VER : " ${{ matrix.python-version }}"
137134 steps :
138135 - name : " Check out repository code"
139136 uses : " actions/checkout@v4"
140137 - name : " Setup environment"
141138 uses : " networktocode/gh-action-setup-poetry-environment@v6"
139+ with :
140+ poetry-version : " 2.1.3"
142141 - name : " Get image version"
143142 run : " echo INVOKE_JDIFF_IMAGE_VER=`poetry version -s`-py${{ matrix.python-version }} >> $GITHUB_ENV"
144143 - name : " Set up Docker Buildx"
@@ -156,18 +155,14 @@ jobs:
156155 cache-from : " type=gha,scope=${{ env.INVOKE_JDIFF_IMAGE_NAME }}-${{ env.INVOKE_JDIFF_IMAGE_VER }}-py${{ matrix.python-version }}"
157156 cache-to : " type=gha,scope=${{ env.INVOKE_JDIFF_IMAGE_NAME }}-${{ env.INVOKE_JDIFF_IMAGE_VER }}-py${{ matrix.python-version }}"
158157 build-args : |
159- PYTHON_VER=${{ env.PYTHON_VER }}
160- - name : " Debug: Show docker images"
161- run : " docker image ls"
158+ PYTHON_VER=${{ matrix.python-version }}
162159 - name : " Run Tests"
163160 run : " poetry run invoke pytest"
164- needs :
165- - " poetry"
166161 changelog :
167162 if : >
168163 contains(fromJson('["develop"]'), github.base_ref) &&
169164 (github.head_ref != 'main') && (!startsWith(github.head_ref, 'release'))
170- runs-on : " ubuntu-22.04 "
165+ runs-on : " ubuntu-latest "
171166 steps :
172167 - name : " Check out repository code"
173168 uses : " actions/checkout@v4"
@@ -176,98 +171,8 @@ jobs:
176171 - name : " Setup environment"
177172 uses : " networktocode/gh-action-setup-poetry-environment@v6"
178173 with :
179- poetry-version : " 1.8.5 "
174+ poetry-version : " 2.1.3 "
180175 - name : " Check for changelog entry"
181176 run : |
182177 git fetch --no-tags origin +refs/heads/${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}
183178 poetry run towncrier check --compare-with origin/${{ github.base_ref }}
184- publish_gh :
185- name : " Publish to GitHub"
186- runs-on : " ubuntu-24.04"
187- # yamllint disable-line rule:quoted-strings
188- if : startsWith(github.ref, 'refs/tags/v')
189- steps :
190- - name : " Check out repository code"
191- uses : " actions/checkout@v4"
192- - name : " Setup environment"
193- uses : " networktocode/gh-action-setup-poetry-environment@v6"
194- with :
195- poetry-version : " 1.8.5"
196- python-version : " 3.12"
197- poetry-install-options : " --no-root"
198- - name : " Set env"
199- run : " echo RELEASE_VERSION=${GITHUB_REF:10} >> $GITHUB_ENV"
200- - name : " Run Poetry Version"
201- run : " poetry version $RELEASE_VERSION"
202- - name : " Build Documentation"
203- run : " poetry run invoke build-and-check-docs"
204- - name : " Run Poetry Build"
205- run : " poetry build"
206- - name : " Upload binaries to release"
207- run : " gh release upload ${{ github.ref_name }} dist/*.{tar.gz,whl}"
208- env :
209- GH_TOKEN : " ${{ secrets.NTC_GITHUB_TOKEN }}"
210- needs :
211- - " pytest"
212- publish_pypi :
213- name : " Push Package to PyPI"
214- runs-on : " ubuntu-24.04"
215- # yamllint disable-line rule:quoted-strings
216- if : startsWith(github.ref, 'refs/tags/v')
217- steps :
218- - name : " Check out repository code"
219- uses : " actions/checkout@v4"
220- - name : " Set up Python"
221- uses : " actions/setup-python@v5"
222- with :
223- python-version : " 3.9"
224- - name : " Install Python Packages"
225- run : " pip install poetry"
226- - name : " Set env"
227- run : " echo RELEASE_VERSION=${GITHUB_REF:10} >> $GITHUB_ENV"
228- - name : " Run Poetry Version"
229- run : " poetry version $RELEASE_VERSION"
230- - name : " Run Poetry Build"
231- run : " poetry build"
232- - name : " Push to PyPI"
233- uses : " pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc" # v1.12.4
234- with :
235- user : " __token__"
236- password : " ${{ secrets.PYPI_API_TOKEN }}"
237- needs :
238- - " pytest"
239- slack-notify :
240- needs :
241- - " publish_gh"
242- - " publish_pypi"
243- runs-on : " ubuntu-24.04"
244- env :
245- SLACK_WEBHOOK_URL : " ${{ secrets.SLACK_WEBHOOK_URL }}"
246- SLACK_MESSAGE : >-
247- *NOTIFICATION: NEW-RELEASE-PUBLISHED*\n
248- Repository: <${{ github.server_url }}/${{ github.repository }}|${{ github.repository }}>\n
249- Release: <${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.ref_name }}|${{ github.ref_name }}>\n
250- Published by: <${{ github.server_url }}/${{ github.actor }}|${{ github.actor }}>
251- steps :
252- - name : " Send a notification to Slack"
253- # ENVs cannot be used directly in job.if. This is a workaround to check
254- # if SLACK_WEBHOOK_URL is present.
255- if : " env.SLACK_WEBHOOK_URL != ''"
256- uses : " slackapi/slack-github-action@fcfb566f8b0aab22203f066d80ca1d7e4b5d05b3" # v1.27.1
257- with :
258- payload : |
259- {
260- "text": "${{ env.SLACK_MESSAGE }}",
261- "blocks": [
262- {
263- "type": "section",
264- "text": {
265- "type": "mrkdwn",
266- "text": "${{ env.SLACK_MESSAGE }}"
267- }
268- }
269- ]
270- }
271- env :
272- SLACK_WEBHOOK_URL : " ${{ secrets.SLACK_WEBHOOK_URL }}"
273- SLACK_WEBHOOK_TYPE : " INCOMING_WEBHOOK"
0 commit comments