Skip to content

Commit c4ed4f8

Browse files
committed
try new release actions
1 parent 4280bdf commit c4ed4f8

File tree

1 file changed

+33
-10
lines changed

1 file changed

+33
-10
lines changed

.github/workflows/wipac-cicd.yml

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,37 @@ jobs:
7575
needs: [flake8, py-setup, pip-install, docker-build]
7676
runs-on: ubuntu-latest
7777
concurrency: release
78+
79+
permissions:
80+
id-token: write
81+
contents: write
82+
7883
steps:
79-
- uses: actions/checkout@v4
80-
with:
81-
fetch-depth: 0
82-
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
83-
- name: Python Semantic Release
84-
uses: relekang/python-semantic-release@v7.34.6
85-
with:
86-
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
87-
#repository_username: __token__
88-
#repository_password: ${{ secrets.PYPI_TOKEN }}
84+
# Note: we need to checkout the repository at the workflow sha in case during the workflow
85+
# the branch was updated. To keep PSR working with the configured release branches,
86+
# we force a checkout of the desired release branch but at the workflow sha HEAD.
87+
- name: Setup | Checkout Repository at workflow sha
88+
uses: actions/checkout@v4
89+
with:
90+
fetch-depth: 0
91+
ref: ${{ github.sha }}
92+
93+
- name: Setup | Force correct release branch on workflow sha
94+
run: |
95+
git checkout -B ${{ github.ref_name }} ${{ github.sha }}
96+
97+
- name: Action | Semantic Version Release
98+
id: release
99+
# Adjust tag with desired version if applicable.
100+
uses: python-semantic-release/python-semantic-release@v9.16.1
101+
with:
102+
github_token: ${{ secrets.GITHUB_TOKEN }}
103+
git_committer_name: "github-actions"
104+
git_committer_email: "actions@users.noreply.github.com"
105+
106+
- name: Publish | Upload to GitHub Release Assets
107+
uses: python-semantic-release/publish-action@v9.16.1
108+
if: steps.release.outputs.released == 'true'
109+
with:
110+
github_token: ${{ secrets.GITHUB_TOKEN }}
111+
tag: ${{ steps.release.outputs.tag }}

0 commit comments

Comments
 (0)