-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (39 loc) · 1.09 KB
/
Copy pathrelease.yml
File metadata and controls
42 lines (39 loc) · 1.09 KB
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
name: release
# Dormant until a maintainer pushes a version tag. Builds, tests, and drafts
# release notes from conventional commits. It never creates or pushes tags.
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-go@v6
with:
go-version: "1.24"
- name: test (race)
run: go test -race -count=2 ./...
- name: generate release notes
id: notes
run: |
prev=$(git describe --tags --abbrev=0 "${GITHUB_REF_NAME}^" 2>/dev/null || echo "")
if [ -n "$prev" ]; then
range="${prev}..${GITHUB_REF_NAME}"
else
range="${GITHUB_REF_NAME}"
fi
{
echo "notes<<EOF"
git log --pretty='- %s' "$range"
echo "EOF"
} >> "$GITHUB_OUTPUT"
- uses: softprops/action-gh-release@v2
with:
body: ${{ steps.notes.outputs.notes }}
generate_release_notes: false