Skip to content

Commit b20e837

Browse files
committed
Add release workfload
Signed-off-by: Kevin Grigorenko <kevin.grigorenko@us.ibm.com>
1 parent 3e9936c commit b20e837

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/release.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
14+
# https://docs.github.com/en/rest/releases/releases#create-a-release
15+
# https://docs.github.com/en/rest/releases/assets#upload-a-release-asset
16+
- name: Create release and upload assets
17+
run: |
18+
RELEASE="$(curl \
19+
--silent \
20+
--show-error \
21+
--fail \
22+
--request POST \
23+
--url https://api.github.com/repos/${{github.repository}}/releases \
24+
--data '{"tag_name":"${{github.ref_name}}","name":"${{github.repository}} ${{github.ref_name}}","draft":false,"prerelease":false}' \
25+
--header "Accept: application/vnd.github.v3+json" \
26+
--header "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" | jq '.id')" && \
27+
curl \
28+
--silent \
29+
--show-error \
30+
--fail \
31+
--request POST \
32+
--url https://uploads.github.com/repos/${{github.repository}}/releases/${RELEASE}/assets?name=containerdiag.sh \
33+
--header "Accept: application/vnd.github.v3+json" \
34+
--header "Content-Type: $(file -b --mime-type containerdiag.sh)" \
35+
--header "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
36+
--data-binary @containerdiag.sh

0 commit comments

Comments
 (0)