Skip to content

Commit 2e2f82e

Browse files
authored
First version of create-release (#11)
1 parent 22cfe0e commit 2e2f82e

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.github/workflows/build-deploy-backend.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,30 @@ jobs:
138138
echo "match=true" >> $GITHUB_OUTPUT
139139
fi
140140
141+
create-release:
142+
needs: semver-tag
143+
if: needs.semver-tag.outputs.release-to-prod == 'true'
144+
name: Create GitHub Release
145+
runs-on: ubuntu-latest
146+
steps:
147+
- name: Create GitHub Release
148+
env:
149+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
150+
TAG_NAME: ${{ github.ref_name }}
151+
REPO: ${{ github.repository }}
152+
run: |
153+
API_URL="https://api.github.com/repos/${REPO}/releases"
154+
JSON_PAYLOAD=$(jq -n \
155+
--arg tag "$TAG_NAME" \
156+
--arg name "$TAG_NAME" \
157+
--arg body "Release $TAG_NAME" \
158+
'{ tag_name: $tag, name: $name, body: $body, draft: false, prerelease: false }')
159+
160+
curl -s -X POST "$API_URL" \
161+
-H "Authorization: Bearer $GITHUB_TOKEN" \
162+
-H "Content-Type: application/json" \
163+
-d "$JSON_PAYLOAD"
164+
141165
142166
assert-artifact:
143167
name: Assert artifacts

0 commit comments

Comments
 (0)