@@ -3,24 +3,32 @@ name: Release Python package with pontos
33on :
44 pull_request :
55 types : [closed]
6+ workflow_dispatch :
67
78jobs :
89 build-and-release :
9- name : Build and release with pontos
10- # If the label 'make release' is set. If PR is closed because of an merge
11- if : contains( github.event.pull_request.labels.*.name, 'make release') && github.event.pull_request.merged == true
12- runs-on : ' ubuntu-latest'
10+ name : Create a new release with pontos
11+ # If the event is a workflow_dispatch or the label 'make release' is set and PR is closed because of a merge
12+ if : (github.event_name == 'workflow_dispatch') || ( contains( github.event.pull_request.labels.*.name, 'make release') && github.event.pull_request.merged == true)
13+ runs-on : " ubuntu-latest"
1314 steps :
14- - name : Release with release action
15- uses : greenbone/actions/release@v2
16- with :
17- version : 3.8
18- conventional-commits : true
19- ref : ${{ github.ref_name }}
20- github-user : ${{ secrets.GREENBONE_BOT }}
21- github-user-mail : ${{ secrets.GREENBONE_BOT_MAIL }}
22- github-user-token : ${{ secrets.GREENBONE_BOT_TOKEN }}
23- gpg-key : ${{ secrets.GPG_KEY }}
24- gpg-fingerprint : ${{ secrets.GPG_FINGERPRINT }}
25- gpg-passphrase : ${{ secrets.GPG_PASSPHRASE }}
26- strategy : patch
15+ - name : Setting the Reference
16+ run : |
17+ if [[ "${{ github.event_name }}" = "workflow_dispatch" ]]; then
18+ echo "RELEASE_REF=${{ github.ref_name }}" >> $GITHUB_ENV
19+ else
20+ echo "RELEASE_REF=${{ github.base_ref }}" >> $GITHUB_ENV
21+ fi
22+ - name : Release with release action
23+ uses : greenbone/actions/release@v2
24+ with :
25+ python-version : " 3.10"
26+ conventional-commits : true
27+ github-user : ${{ secrets.GREENBONE_BOT }}
28+ github-user-mail : ${{ secrets.GREENBONE_BOT_MAIL }}
29+ github-user-token : ${{ secrets.GREENBONE_BOT_TOKEN }}
30+ gpg-key : ${{ secrets.GPG_KEY }}
31+ gpg-fingerprint : ${{ secrets.GPG_FINGERPRINT }}
32+ gpg-passphrase : ${{ secrets.GPG_PASSPHRASE }}
33+ strategy : calendar
34+ ref : ${{ env.RELEASE_REF }}
0 commit comments