-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (41 loc) · 1.12 KB
/
build-and-test.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
name: Build and Test for Windows and Ubuntu
on:
push:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@main
- name: Set up Go
uses: actions/setup-go@main
with:
go-version: '1.21.6'
- name: Run Tests
run: go test ./...
build:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@main
- name: Set up Go
uses: actions/setup-go@main
with:
go-version: '1.21.6'
- name: Build for Windows
run: GOOS=windows GOARCH=amd64 go build -o ssh-keyword.exe ./cmd/main.go
- name: Build for Ubuntu
run: GOOS=linux GOARCH=amd64 go build -o ssh-keyword-linux-amd64 ./cmd/main.go
- name: Upload Windows Binary
uses: actions/upload-artifact@main
with:
name: windows-binary
path: ssh-keyword.exe
- name: Upload Ubuntu Binary
uses: actions/upload-artifact@main
with:
name: ubuntu-binary
path: ssh-keyword-linux-amd64