11name : Generate Next Release
22# This workflow will generate changelog and release notes.
3- # Source: https://github.com/terraform-aws-modules/terraform-aws-vpc/blob/master/.github/workflows/release.yml
43
54on :
65 workflow_dispatch :
98 DIST_DIR : dist
109jobs :
1110 release :
12- name : Build and publish package
11+ name : Create next release
1312 runs-on : ubuntu-latest
1413 permissions :
1514 id-token : write
1615
16+ outputs :
17+ new_release_published : ${{ steps.release.outputs.new_release_published }}
18+
1719 steps :
1820 - name : Checkout
1921 uses : actions/checkout@v4
2022 with :
2123 fetch-depth : 0
2224 ssh-key : ${{ secrets.DEPLOY_KEY }}
2325
24- - name : Install Python
25- uses : actions/setup-python@v5
26- with :
27- python-version-file : .python-version
28-
29- - name : Install dependencies
30- run : |
31- python -m pip install --upgrade build
32-
3326 - name : Create GitHub release
27+ id : release
3428 uses : cycjimmy/semantic-release-action@v4
3529 with :
3630 semantic_version : 19.0.5
@@ -46,11 +40,32 @@ jobs:
4640 GIT_COMMITTER_EMAIL : bot@equinix.noreply.github.com
4741 RELEASE_REQUESTER : " @${{ github.event.sender.login }}"
4842
43+ publish :
44+ name : Publish artifacts
45+ runs-on : ubuntu-latest
46+ needs : release
47+ if : needs.release.outputs.new_release_published == 'true'
48+ steps :
49+ - name : Checkout
50+ uses : actions/checkout@v4
51+ with :
52+ fetch-depth : 0
53+ ssh-key : ${{ secrets.DEPLOY_KEY }}
54+
55+ - name : Install Python
56+ uses : actions/setup-python@v5
57+ with :
58+ python-version-file : .python-version
59+
60+ - name : Install dependencies
61+ run : |
62+ python -m pip install --upgrade build
63+
4964 - name : Build package
5065 run : |
5166 python -m build --sdist --wheel --outdir ${{ env.DIST_DIR }} .
5267
53- - name : Publish package
68+ - name : Publish to PyPI
5469 uses : pypa/gh-action-pypi-publish@release/v1
5570 with :
5671 packages-dir : ${{ env.DIST_DIR }}
0 commit comments