Skip to content

Commit 11ac616

Browse files
author
Jake Soenneker
committed
Releases added to action
1 parent cd92de2 commit 11ac616

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

.github/workflows/publish-package.yml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
name: publish-package
1+
name: publish-package
22
on:
33
push:
44
branches:
55
- main
66
paths-ignore:
77
- 'test/**'
88

9-
tags:
10-
- v*
119

1210
env:
1311
"PipelineEnvironment": true
@@ -94,3 +92,28 @@ jobs:
9492
dotnet nuget push ./*.nupkg \
9593
--source "github" \
9694
--api-key ${{ secrets.GH_TOKEN }}
95+
96+
- name: Create GitHub Release
97+
run: |
98+
changelog=$(git log -20 --pretty=format:"- %s")
99+
tag_name="v$BUILD_VERSION"
100+
101+
json_payload=$(
102+
jq -n \
103+
--arg tag_name "$tag_name" \
104+
--arg name "$tag_name" \
105+
--arg body "$changelog" \
106+
'{
107+
tag_name: $tag_name,
108+
name: $name,
109+
body: $body,
110+
draft: false,
111+
prerelease: false
112+
}'
113+
)
114+
115+
curl -s -X POST \
116+
-H "Authorization: Bearer ${{ secrets.GH_TOKEN }}" \
117+
-H "Accept: application/vnd.github+json" \
118+
https://api.github.com/repos/${{ github.repository }}/releases \
119+
-d "$json_payload"

0 commit comments

Comments
 (0)