-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (49 loc) · 1.52 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
name: Release on master build
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Create releases directory
run: mkdir releases
- name: Build for Linux (amd64)
run: go build -o ./releases/regexp_utility-$GOOS-$GOARCH regexp_utility.go
env:
GOOS: linux
GOARCH: amd64
- name: Build for Intel based Macs (amd64)
run: go build -o ./releases/regexp_utility-$GOOS-$GOARCH regexp_utility.go
env:
GOOS: darwin
GOARCH: amd64
- name: Build for Apple Silicon based Macs (arm64)
run: go build -o ./releases/regexp_utility-$GOOS-$GOARCH regexp_utility.go
env:
GOOS: darwin
GOARCH: arm64
- 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@v1
with:
tag_name: ${{ steps.gen_tag.outputs.release_tag }}
generate_release_notes: true
files: |
releases/regexp_utility-linux-amd64
releases/regexp_utility-darwin-amd64
releases/regexp_utility-darwin-arm64