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