@@ -30,15 +30,13 @@ permissions:
3030 id-token : write
3131
3232jobs :
33- # Call the lint workflow first
3433 lint :
3534 name : Lint Check
3635 uses : ./.github/workflows/lint.yml
3736 permissions :
3837 contents : read
3938 pull-requests : read
4039
41- # Call the test workflow next
4240 test :
4341 name : Run Tests
4442 needs : [lint]
4745 contents : read
4846 checks : write
4947
50- # Finally run the release job
5148 release :
5249 name : Create Release
5350 runs-on : ubuntu-latest
54- # Only run release on main branch and when not triggered by automated commits
5551 if : |
5652 github.ref == 'refs/heads/main' &&
5753 github.actor != 'github-actions[bot]' &&
@@ -66,32 +62,20 @@ jobs:
6662 with :
6763 fetch-depth : 0
6864 token : ${{ secrets.PAT_TOKEN }}
69- ref : ${{ github.sha }}
7065
71- - name : Force correct release branch
72- run : |
73- git checkout -B ${{ github.ref_name }} ${{ github.sha }}
74-
75- - name : Setup Python and Dependencies
76- run : |
77- pip install python-semantic-release==9.15.0
78- git config --global user.name "github-actions[bot]"
79- git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
66+ - name : Set up Python
67+ uses : actions/setup-python@v4
68+ with :
69+ python-version : " 3.11"
70+ cache : " pip"
8071
81- - name : Generate Changelog
82- env :
83- GH_TOKEN : ${{ secrets.PAT_TOKEN }}
72+ - name : Install Poetry
8473 run : |
85- # Generate changelog regardless of release
86- semantic-release changelog
74+ pip install poetry==1.8.5
75+ poetry config virtualenvs.create false
8776
88- # Commit changelog if changed
89- if [[ -n $(git status --porcelain CHANGELOG.md) ]]; then
90- git pull origin ${{ github.ref_name }} --rebase
91- git add CHANGELOG.md
92- git commit -m "docs: update CHANGELOG.md [skip ci]"
93- git push origin HEAD:${{ github.ref_name }}
94- fi
77+ - name : Install dependencies
78+ run : poetry install
9579
9680 - name : Python Semantic Release
9781 id : release
@@ -103,10 +87,9 @@ jobs:
10387 force : ${{ inputs.force != 'none' && inputs.force || '' }}
10488 git_committer_name : " github-actions[bot]"
10589 git_committer_email : " 41898282+github-actions[bot]@users.noreply.github.com"
106-
107- - name : Publish to GitHub Release Assets
108- uses : python-semantic-release/publish-action@v9.15.0
109- if : steps.release.outputs.released == 'true'
110- with :
111- github_token : ${{ secrets.PAT_TOKEN }}
112- tag : ${{ steps.release.outputs.tag }}
90+ changelog : true
91+ commit : true
92+ push : true
93+ build : true
94+ tag : true
95+ vcs_release : true
0 commit comments