-
Notifications
You must be signed in to change notification settings - Fork 547
46 lines (39 loc) · 1.08 KB
/
release-build.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
name: Release Build
on:
push:
tags:
- "v*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout tag
run: |
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
tag_name="${GITHUB_REF##*/}"
echo Current tag: $tag_name
git checkout $tag_name
echo "TAG_NAME=${tag_name}" >> $GITHUB_ENV
- name: Check VERSION consistency
run: |
tag=$(git describe --tags --dirty)
version=$(cat VERSION)
if [ "$tag" != "$version" ]; then
echo "VERSION file is not consistent with tag name"
echo "VERSION: $version"
echo "TAG: $tag"
exit 1
fi
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.21"
- name: Install goreleaser
run: |
go install github.com/goreleaser/goreleaser@latest
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WINGET_PKGS_PRIVATE_KEY: ${{ secrets.WINGET_PKGS_PRIVATE_KEY }}
run: goreleaser release -p 4