@@ -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 :
@@ -106,8 +104,8 @@ jobs:
106104 strategy :
107105 fail-fast : true
108106 matrix :
109- python-version : ["3.12 "]
110- nautobot-version : ["2.4.9 "]
107+ python-version : ["3.11 "]
108+ nautobot-version : ["2.4.20 "]
111109 env :
112110 INVOKE_NAUTOBOT_NETBOX_IMPORTER_PYTHON_VER : " ${{ matrix.python-version }}"
113111 INVOKE_NAUTOBOT_NETBOX_IMPORTER_NAUTOBOT_VER : " ${{ matrix.nautobot-version }}"
@@ -121,8 +119,7 @@ jobs:
121119 - name : " Constrain Nautobot version and regenerate lock file"
122120 env :
123121 INVOKE_NAUTOBOT_NETBOX_IMPORTER_LOCAL : " true"
124- PY_CONSTRAINT : " ${{ matrix.python-version == '3.9' && '3.9.2' || matrix.python-version }}"
125- run : " poetry run invoke lock --constrain-nautobot-ver --constrain-python-ver=${{ env.PY_CONSTRAINT }}"
122+ run : " poetry run invoke lock --constrain-nautobot-ver --constrain-python-ver=${{ matrix.python-version }}"
126123 - name : " Set up Docker Buildx"
127124 id : " buildx"
128125 uses : " docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2" # v3.10.0
@@ -153,9 +150,9 @@ jobs:
153150 strategy :
154151 fail-fast : true
155152 matrix :
156- python-version : ["3.9 "] # 3.12 2.4 is tested in unittest_report stage.
153+ python-version : ["3.10 "] # 3.12 2.4 is tested in unittest_report stage.
157154 db-backend : ["postgresql"]
158- nautobot-version : ["2.4.9 "]
155+ nautobot-version : ["2.4.20 "]
159156 runs-on : " ubuntu-latest"
160157 env :
161158 INVOKE_NAUTOBOT_NETBOX_IMPORTER_PYTHON_VER : " ${{ matrix.python-version }}"
@@ -170,8 +167,7 @@ jobs:
170167 - name : " Constrain Nautobot version and regenerate lock file"
171168 env :
172169 INVOKE_NAUTOBOT_NETBOX_IMPORTER_LOCAL : " true"
173- PY_CONSTRAINT : " ${{ matrix.python-version == '3.9' && '3.9.2' || matrix.python-version }}"
174- run : " poetry run invoke lock --constrain-nautobot-ver --constrain-python-ver=${{ env.PY_CONSTRAINT }}"
170+ run : " poetry run invoke lock --constrain-nautobot-ver --constrain-python-ver=${{ matrix.python-version }}"
175171 - name : " Set up Docker Buildx"
176172 id : " buildx"
177173 uses : " docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2" # v3.10.0
@@ -222,8 +218,7 @@ jobs:
222218 - name : " Constrain Nautobot version and regenerate lock file"
223219 env :
224220 INVOKE_NAUTOBOT_NETBOX_IMPORTER_LOCAL : " true"
225- PY_CONSTRAINT : " ${{ matrix.python-version == '3.9' && '3.9.2' || matrix.python-version }}"
226- run : " poetry run invoke lock --constrain-nautobot-ver --constrain-python-ver=${{ env.PY_CONSTRAINT }}"
221+ run : " poetry run invoke lock --constrain-nautobot-ver --constrain-python-ver=${{ matrix.python-version }}"
227222 - name : " Set up Docker Buildx"
228223 id : " buildx"
229224 uses : " docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2" # v3.10.0
@@ -288,101 +283,3 @@ jobs:
288283 run : |
289284 git fetch --no-tags origin +refs/heads/${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}
290285 poetry run towncrier check --compare-with origin/${{ github.base_ref }}
291- publish_gh :
292- needs :
293- - " unittest"
294- - " unittest_report"
295- name : " Publish to GitHub"
296- runs-on : " ubuntu-latest"
297- if : " startsWith(github.ref, 'refs/tags/v')"
298- env :
299- INVOKE_NAUTOBOT_NETBOX_IMPORTER_LOCAL : " True"
300- permissions :
301- contents : " write"
302- steps :
303- - name : " Check out repository code"
304- uses : " actions/checkout@v4"
305- - name : " Setup environment"
306- uses : " networktocode/gh-action-setup-poetry-environment@v6"
307- with :
308- poetry-version : " 2.1.3"
309- python-version : " 3.12"
310- poetry-install-options : " --no-root"
311- - name : " Set env"
312- run : " echo RELEASE_VERSION=${GITHUB_REF:10} >> $GITHUB_ENV"
313- - name : " Run Poetry Version"
314- run : " poetry version $RELEASE_VERSION"
315- - name : " Build Documentation"
316- run : " poetry run invoke build-and-check-docs"
317- - name : " Run Poetry Build"
318- run : " poetry build"
319- - name : " Upload binaries to release"
320- run : " gh release upload ${{ github.ref_name }} dist/*.{tar.gz,whl}"
321- env :
322- GH_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
323- publish_pypi :
324- needs :
325- - " unittest"
326- - " unittest_report"
327- name : " Push Package to PyPI"
328- runs-on : " ubuntu-latest"
329- if : " startsWith(github.ref, 'refs/tags/v')"
330- env :
331- INVOKE_NAUTOBOT_NETBOX_IMPORTER_LOCAL : " True"
332- steps :
333- - name : " Check out repository code"
334- uses : " actions/checkout@v4"
335- - name : " Setup environment"
336- uses : " networktocode/gh-action-setup-poetry-environment@v6"
337- with :
338- poetry-version : " 2.1.3"
339- python-version : " 3.12"
340- poetry-install-options : " --no-root"
341- - name : " Set env"
342- run : " echo RELEASE_VERSION=${GITHUB_REF:10} >> $GITHUB_ENV"
343- - name : " Run Poetry Version"
344- run : " poetry version $RELEASE_VERSION"
345- - name : " Build Documentation"
346- run : " poetry run invoke build-and-check-docs"
347- - name : " Run Poetry Build"
348- run : " poetry build"
349- - name : " Push to PyPI"
350- uses : " pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc" # v1.12.4
351- with :
352- user : " __token__"
353- password : " ${{ secrets.PYPI_API_TOKEN }}"
354- slack-notify :
355- needs :
356- - " publish_gh"
357- - " publish_pypi"
358- runs-on : " ubuntu-latest"
359- env :
360- SLACK_WEBHOOK_URL : " ${{ secrets.OSS_PYPI_SLACK_WEBHOOK_URL }}"
361- SLACK_MESSAGE : >-
362- *NOTIFICATION: NEW-RELEASE-PUBLISHED*\n
363- Repository: <${{ github.server_url }}/${{ github.repository }}|${{ github.repository }}>\n
364- Release: <${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.ref_name }}|${{ github.ref_name }}>\n
365- Published by: <${{ github.server_url }}/${{ github.actor }}|${{ github.actor }}>
366- steps :
367- - name : " Send a notification to Slack"
368- # ENVs cannot be used directly in job.if. This is a workaround to check
369- # if SLACK_WEBHOOK_URL is present.
370- if : " env.SLACK_WEBHOOK_URL != ''"
371- uses : " slackapi/slack-github-action@fcfb566f8b0aab22203f066d80ca1d7e4b5d05b3" # v1.27.1
372- with :
373- payload : |
374- {
375- "text": "${{ env.SLACK_MESSAGE }}",
376- "blocks": [
377- {
378- "type": "section",
379- "text": {
380- "type": "mrkdwn",
381- "text": "${{ env.SLACK_MESSAGE }}"
382- }
383- }
384- ]
385- }
386- env :
387- SLACK_WEBHOOK_URL : " ${{ secrets.OSS_PYPI_SLACK_WEBHOOK_URL }}"
388- SLACK_WEBHOOK_TYPE : " INCOMING_WEBHOOK"
0 commit comments