-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (125 loc) · 3.62 KB
/
ci.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Nightly Build
on:
push:
branches:
- master
env:
CGO_ENABLED: 1
GO_VERSION: 1.21.4
jobs:
compile-windows-amd64:
runs-on: windows-2019
env:
GOOS: windows
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- working-directory: ./server
env:
GOARCH: amd64
run: |
go version
go mod download
go build -o cmd/bugbuddy_windows_amd64.exe cli/main.go
- name: Create binary only artifact
uses: actions/upload-artifact@v4
with:
name: windows_amd64
path: ./server/cmd/bugbuddy_windows_amd64.exe
compile-linux-amd64:
runs-on: ubuntu-latest
env:
GOOS: linux
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- working-directory: ./server
env:
GOARCH: amd64
run: |
go version
go mod download
go build -o cmd/bugbuddy_linux_amd64 cli/main.go
- name: Create binary only artifact
uses: actions/upload-artifact@v4
with:
name: linux_amd64
path: ./server/cmd/bugbuddy_linux_amd64
compile-macos-amd64:
runs-on: macos-latest
env:
GOOS: darwin
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Build amd64 binary
env:
GOARCH: amd64
run: |
go version
go mod download
go build -o server/cmd/bugbuddy_macos_amd64 server
- name: Build arm64 binary
env:
GOARCH: arm64
run: |
go version
go mod download
go build -o server/cmd/bugbuddy_macos_arm64 server
- name: Create universal binary
run: lipo -create -output server/cmd/bugbuddy_macos_universal server/cmd/bugbuddy_macos_amd64 server/cmd/bugbuddy_macos_arm64
- name: Create binary only artifact
uses: actions/upload-artifact@v4
with:
name: macos_universal
path: ./server/cmd/bugbuddy_macos_universal
release-nightly:
name: Create Github Release
needs:
- compile-windows-amd64
- compile-linux-amd64
- compile-macos-amd64
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- name: Fetch linux_amd64
uses: actions/download-artifact@v1
with:
name: linux_amd64
path: ./linux_amd64
- name: Fetch macos_universal
uses: actions/download-artifact@v1
with:
name: macos_universal
path: ./macos_universal
- name: Fetch windows_amd64
uses: actions/download-artifact@v1
with:
name: windows_amd64
path: ./windows_amd64
- name: Generate file checksums
run: |
sha256sum \
./windows_amd64/bugbuddy_windows_amd64.exe \
./linux_amd64/bugbuddy_linux_amd64 \
./macos_universal/bugbuddy_macos_universal \
> checksums.txt
- uses: "marvinpinto/action-automatic-releases@latest"
name: Create Release and Upload Assets
id: create_release
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
title: "Latest Nightly Build"
files: |
windows_amd64/bugbuddy_windows_amd64.exe
linux_amd64/bugbuddy_linux_amd64
macos_universal/bugbuddy_macos_universal
checksums.txt