-
-
Notifications
You must be signed in to change notification settings - Fork 402
132 lines (108 loc) · 2.98 KB
/
go.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
132
name: Go
on:
push:
tags: ["v*"]
paths-ignore:
- "**/*.md"
- "**/*.nix"
- "**/*.lock"
pull_request:
branches: [main]
paths-ignore:
- "**/*.md"
- "**/*.nix"
- "**/*.lock"
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"
- name: Build
run: go build -v ./...
- name: Test
run: go test -v ./...
build-macos:
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"
- name: Build
run: go build -v ./...
- name: Test
run: go test -v ./...
binaries-linux:
needs: "build-linux"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"
- name: install gcc-aarch64-linux-gnu
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
- name: generate binaries
run: |
OS=Linux ARCH=x86_64 make
OS=Linux ARCH=aarch64 make
- name: upload artifacts
uses: actions/upload-artifact@v3
with:
name: artifacts-linux
path: _output/binaries/
binaries-macos:
needs: "build-macos"
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"
- name: generate binaries
run: |
CGO_ENABLED=1 OS=Darwin ARCH=x86_64 make
CGO_ENABLED=1 OS=Darwin ARCH=arm64 make
- name: upload artifacts
uses: actions/upload-artifact@v3
with:
name: artifacts-macos
path: _output/binaries/
release:
needs: ["binaries-linux", "binaries-macos"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: artifacts-linux
path: _output/binaries/
- uses: actions/download-artifact@v3
with:
name: artifacts-macos
path: _output/binaries/
- name: create release
if: github.event_name != 'pull_request'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: >
tag="${GITHUB_REF##*/}"
hub release create
-a _output/binaries/colima-Darwin-x86_64
-a _output/binaries/colima-Darwin-x86_64.sha256sum
-a _output/binaries/colima-Darwin-arm64
-a _output/binaries/colima-Darwin-arm64.sha256sum
-a _output/binaries/colima-Linux-x86_64
-a _output/binaries/colima-Linux-x86_64.sha256sum
-a _output/binaries/colima-Linux-aarch64
-a _output/binaries/colima-Linux-aarch64.sha256sum
-m "${tag}" --draft "${tag}"