-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (40 loc) · 1.28 KB
/
prepare.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
name: Release
on:
push:
branches:
- release/*
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.20
- name: Release Verseion
run: echo $RELEASE_VERSION=$(echo $GITHUB_REF_NAME | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+.*$') >> $GITHUB_ENV
- name: Version Check
run: |
if ! grep -q "$RELEASE_VERSION" version.txt; then
echo "version.txt does not match $RELEASE_VERSION!"
exit 1
fi
- name: Changes Heading Up-To-Date Check
run: |
date=$(date "+%Y-%m-%d")
header=$(head -n1 Changes.md)
if [ "$header" != "## $RELEASE_VERSION $date" ]; then
echo "Changes.md is out of date!"
echo "Expected header: ## $RELEASE_VERSION $date"
echo "Found header: $header"
exit 1
else
echo "Changes.md heading looks good."
fi
- name: Release Notes Capture
run: |
sed -n '/^## [0-9]/{:loop n; /^## [0-9]/q; p; b loop}' Changes.md > release-notes.md
echo "Release Notes Will be..."
echo "========================"
cat release-notes.md