forked from 360quake/quake_go
-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (80 loc) · 2.32 KB
/
go_build_test.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
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
87
88
name: go_build_test
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
env:
TEST_TAG: latest-go-build-test
jobs:
release:
name: go-build-test-jobs
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: Setup docker-compose
uses: KengoTODA/actions-setup-docker-compose@v1
with:
version: '1.29.2'
- name: Force Delete Release
uses: dev-drprasad/delete-tag-and-release@master
with:
delete_release: true
tag_name: ${{ env.TEST_TAG }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create/Update tag
uses: rickstaa/action-create-tag@v1
with:
tag: ${{ env.TEST_TAG }}
message: "go build test"
force_push_tag: true
- name: Create Release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.TEST_TAG }}
release_name: ${{ env.TEST_TAG }}
draft: false
prerelease: false
publish:
needs: release
name: Release Go Binary
runs-on: ubuntu-latest
strategy:
matrix:
# build and publish in parallel: linux/386, linux/amd64, linux/arm64, windows/386, windows/amd64, darwin/amd64, darwin/arm64
goos: [ linux, windows, darwin ]
goarch: [ "386", amd64, arm64 ]
exclude:
- goarch: "386"
goos: darwin
- goarch: arm64
goos: windows
steps:
- uses: actions/checkout@v3
- uses: wangyoucao577/go-release-action@master
with:
release_tag : ${{ env.TEST_TAG }}
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: "https://dl.google.com/go/go1.19.linux-amd64.tar.gz"
project_path: "."
binary_name: "quake"
extra_files: README.md
clean:
name: clean release
needs: publish
runs-on: ubuntu-latest
steps:
- name: Force Delete Release
uses: dev-drprasad/delete-tag-and-release@master
with:
delete_release: true
tag_name: ${{ env.TEST_TAG }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}