-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (72 loc) · 1.83 KB
/
release-on-master-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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Release on master build
on:
push:
branches:
- master
env:
# Common versions
GO_VERSION: '1.22.4'
GOLANGCI_LINT_VERSION: '1.59.1'
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Lint
uses: golangci/golangci-lint-action@v6
with:
version: ${{ env.GOLANGCI_VERSION }}
- name: Run quality control checks
run: make vet
- name: Run tests
run: make test
build:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
os:
- linux
- darwin
arch:
- amd64
- arm64
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Create releases directory
run: mkdir releases
- name: Build
run: make build OUTPUT_PATH=releases/regexp_utility-${{ matrix.os }}-${{ matrix.arch }}
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
release:
runs-on: ubuntu-latest
needs:
- test
- build
steps:
- name: Generate release tag
id: gen_tag
run: |
SHORT_REV=$(git rev-parse --short "$GITHUB_SHA")
echo "::set-output name=release_tag::release-$SHORT_REV"
- name: Push new tag
run: |
git tag ${{ steps.gen_tag.outputs.release_tag }}
git push origin master ${{ steps.gen_tag.outputs.release_tag }}
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.gen_tag.outputs.release_tag }}
generate_release_notes: true
files: |
releases/regexp_utility-*