Skip to content

Commit 5b6791a

Browse files
committed
setting up for first release
Signed-off-by: Tim Bray <tbray@textuality.com>
1 parent ce168dc commit 5b6791a

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

.github/workflows/release.yaml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Release
2+
3+
on:
4+
# release will only be created when ref is a tag starting with "v"
5+
push:
6+
tags:
7+
- "v*"
8+
9+
workflow_dispatch:
10+
inputs:
11+
tag:
12+
required: true
13+
type: string
14+
description: Use this existing Git tag to create the release
15+
16+
jobs:
17+
release:
18+
name: Create Release
19+
timeout-minutes: 10
20+
strategy:
21+
matrix:
22+
go-version: ["1.19"]
23+
platform: ["ubuntu-latest"]
24+
runs-on: ${{ matrix.platform }}
25+
env:
26+
TAG: ${{ github.event.inputs.tag }}
27+
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
31+
with:
32+
fetch-depth: 0
33+
ref: "main"
34+
35+
- name: Get short TAG
36+
if: ${{ github.event_name != 'workflow_dispatch' }}
37+
run: |
38+
echo "Retrieving tag from Github ref"
39+
echo "TAG=$(basename "${{ github.ref }}")" >> $GITHUB_ENV
40+
41+
- name: Create CHANGELOG for Release (tag)
42+
env:
43+
IMAGE: quay.io/git-chglog/git-chglog
44+
# https://quay.io/repository/git-chglog/git-chglog from tag v0.14.2
45+
IMAGE_SHA: 998e89dab8dd8284cfff5f8cfb9e9af41fe3fcd4671f2e86a180e453c20959e3
46+
run: |
47+
# generate CHANGELOG for this Github release tag only
48+
echo "Using tag $TAG to create release notes"
49+
docker run --rm -v $PWD:/workdir ${IMAGE}@sha256:${IMAGE_SHA} -o RELEASE_CHANGELOG.md $TAG
50+
51+
# send to job summary
52+
cat RELEASE_CHANGELOG.md >> $GITHUB_STEP_SUMMARY
53+
54+
- name: Create Github Release
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
run: |
58+
echo "Using tag $TAG to create release"
59+
gh release create -F RELEASE_CHANGELOG.md ${TAG} LICENSE README.md
60+

0 commit comments

Comments
 (0)