Skip to content

Commit 0133bf4

Browse files
author
Jake Soenneker
committed
Releases added to action
1 parent 90985e1 commit 0133bf4

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

.github/workflows/publish-package.yml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: publish-package
1+
name: publish-package
22
on:
33
push:
44
branches:
@@ -7,8 +7,7 @@ on:
77
- 'test/**'
88

99
# Publish `v1.2.3` tags as releases.
10-
tags:
11-
- v*
10+
1211

1312
env:
1413
"PipelineEnvironment": true
@@ -100,3 +99,28 @@ jobs:
10099

101100
- name: Deploy to GitHub Pages
102101
uses: actions/deploy-pages@v4
102+
103+
- name: Create GitHub Release
104+
run: |
105+
changelog=$(git log -20 --pretty=format:"- %s")
106+
tag_name="v$BUILD_VERSION"
107+
108+
json_payload=$(
109+
jq -n \
110+
--arg tag_name "$tag_name" \
111+
--arg name "$tag_name" \
112+
--arg body "$changelog" \
113+
'{
114+
tag_name: $tag_name,
115+
name: $name,
116+
body: $body,
117+
draft: false,
118+
prerelease: false
119+
}'
120+
)
121+
122+
curl -s -X POST \
123+
-H "Authorization: Bearer ${{ secrets.GH_TOKEN }}" \
124+
-H "Accept: application/vnd.github+json" \
125+
https://api.github.com/repos/${{ github.repository }}/releases \
126+
-d "$json_payload"

0 commit comments

Comments
 (0)