Skip to content

Commit f8d491a

Browse files
author
Jake Soenneker
committed
Releases added to action
1 parent 860d878 commit f8d491a

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
@@ -60,3 +59,28 @@ jobs:
6059
dotnet nuget push ./*.nupkg \
6160
--source "github" \
6261
--api-key ${{ secrets.GH_TOKEN }}
62+
63+
- name: Create GitHub Release
64+
run: |
65+
changelog=$(git log -20 --pretty=format:"- %s")
66+
tag_name="v$BUILD_VERSION"
67+
68+
json_payload=$(
69+
jq -n \
70+
--arg tag_name "$tag_name" \
71+
--arg name "$tag_name" \
72+
--arg body "$changelog" \
73+
'{
74+
tag_name: $tag_name,
75+
name: $name,
76+
body: $body,
77+
draft: false,
78+
prerelease: false
79+
}'
80+
)
81+
82+
curl -s -X POST \
83+
-H "Authorization: Bearer ${{ secrets.GH_TOKEN }}" \
84+
-H "Accept: application/vnd.github+json" \
85+
https://api.github.com/repos/${{ github.repository }}/releases \
86+
-d "$json_payload"

0 commit comments

Comments
 (0)