-
Notifications
You must be signed in to change notification settings - Fork 21
42 lines (35 loc) · 972 Bytes
/
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
name: Release
on:
push:
tags: ["*"]
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
# allow creating releases
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: |
go version
go get
- run: make build
- working-directory: ./example/echo-server
run: make build
- name: Create release
env:
GH_TOKEN: ${{ github.token }}
run: |
TAG=$(git describe --tags --abbrev=0 HEAD)
LAST_TAG=$(git describe --tags --abbrev=0 HEAD^ || true)
[[ -n $LAST_TAG ]] && RANGE=$LAST_TAG..HEAD || RANGE=HEAD
RELEASE_NOTES=$(git log "$RANGE" --oneline --decorate)
gh release create --notes "$RELEASE_NOTES" "$TAG" \
./bin/* \
./example/echo-server/bin/*