@@ -104,7 +104,7 @@ jobs:
104104 git config user.name "${GITHUB_ACTOR}"
105105 git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
106106 git tag -a "${tag}" -m "${message}"
107- git push origin "${tag}"
107+ # tag stays local — pushed at the end of the job, after the release is fully built
108108 - name : Build GoReleaser Args
109109 run : |
110110 args='release --clean --debug --timeout 90m'
@@ -141,6 +141,36 @@ jobs:
141141 env :
142142 COSIGN_PASSWORD : ${{ secrets.COSIGN_PASSWORD }}
143143
144+ - name : Create GitHub Release
145+ env :
146+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
147+ run : |
148+ set -euo pipefail
149+ shopt -s failglob
150+
151+ common=(
152+ "${{ inputs.tag }}"
153+ dist/*.tar.gz dist/*.zip dist/*checksums*
154+ --target "${{ github.sha }}"
155+ --title "Checkmarx One CLI ${{ inputs.tag }}"
156+ --generate-notes
157+ --draft
158+ )
159+
160+ if [ "${{ inputs.dev }}" = "true" ]; then
161+ gh release create "${common[@]}" --prerelease
162+ gh release edit "${{ inputs.tag }}" --draft=false
163+ else
164+ gh release create "${common[@]}"
165+ gh release edit "${{ inputs.tag }}" --draft=false --latest
166+ fi
167+
168+ - name : Cleanup draft release on failure
169+ if : failure()
170+ env :
171+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
172+ run : gh release delete "${{ inputs.tag }}" --cleanup-tag --yes || true
173+
144174 notify :
145175 name : Update Teams & JIRA About New Release
146176 if : inputs.dev == false && 1 == 0
@@ -163,3 +193,4 @@ jobs:
163193 with :
164194 cli_version : ${{ inputs.tag }}
165195 secrets : inherit
196+
0 commit comments