-
Notifications
You must be signed in to change notification settings - Fork 72
58 lines (48 loc) · 1.38 KB
/
Copy pathrelease.yml
File metadata and controls
58 lines (48 loc) · 1.38 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Release Build
on:
push:
branches:
- 'release/v*.*.*'
permissions:
contents: write
jobs:
build-and-release:
runs-on: ubuntu-latest
name: Build and Release
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Configure Git
run: |
git config --global user.email "github-actions@github.com"
git config --global user.name "github-actions"
- name: Extract release version from branch name
run: |
VERSION=${GITHUB_REF#refs/heads/release/}
echo "RELEASE_TAG=$VERSION" >> $GITHUB_ENV
- name: Create Git tag
run: |
git fetch --tags
if ! git rev-parse "$RELEASE_TAG" >/dev/null 2>&1; then
git tag "$RELEASE_TAG"
git push origin "$RELEASE_TAG"
else
echo "Tag $RELEASE_TAG already exists."
fi
- name: Build binaries
run: make build
- name: Create GitHub Release and attach binaries
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.RELEASE_TAG }}
name: ${{ env.RELEASE_TAG }}
files: |
bin/*
draft: true
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}