-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (55 loc) · 1.97 KB
/
release.yml
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
61
62
63
64
65
66
67
name: Publish Tagged Release
on:
push:
# run only against tags
tags:
- '*'
jobs:
publish_release:
permissions:
id-token: write # This is required for requesting the JWT
contents: write # This is required to check out the code and write releases
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: main
fetch-tags: true
fetch-depth: 0
- name: Fetch all tags
run: git fetch --force --tags
- name: Install asdf & tools # except ruby; not required for releasing
uses: asdf-vm/actions/install@v3
with:
before_install: "sed -E -i '/^ruby.+$/d' .tool-versions"
- name: Setup build dependencies
run: |
go install github.com/restechnica/semverbot/cmd/sbot@latest
asdf reshim golang
which sbot
- name: Run Validation
run: task cit
- name: Read Previous Version
run: echo "last_tag=$(git tag --sort=-version:refname | head -n 2 | tail -n 1)" >> $GITHUB_ENV
- name: Read Latest Version
run: echo "this_tag=$(git tag --sort=-version:refname | head -n 2 | head -n 1 )" >> $GITHUB_ENV
- name: Generate Release Notes for this version
id: chglog
run: |
task preview-release-notes
echo "store multiline markdown output as a github env var:"
echo 'release_notes_md=<<EOF' >> $GITHUB_ENV
cat ./RELEASE_NOTES.md >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
cat $GITHUB_ENV
- name: Publish Release
id: publish_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ env.this_tag }}
release_name: Release ${{ env.this_tag }}
body: ${{ env.release_notes_md }}
draft: false
prerelease: false