-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (85 loc) · 2.77 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
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Go
on:
push:
branches: [ "main" ]
tags: [ "v*" ]
pull_request:
branches: [ "main" ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 'stable'
check-latest: true
cache: true
- name: Install packages
run: sudo apt install -y libasound2-dev
- name: Test
run: go test -v ./...
build-linux-and-windows:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 'stable'
check-latest: true
cache: true
- name: Install packages
run: sudo apt install -y libasound2-dev
- name: Install gox
run: go install github.com/mitchellh/gox@latest
- name: Build
run: gox -output="./output/radio_{{.OS}}_{{.Arch}}" -osarch="windows/amd64 windows/386 linux/amd64"
- name: Upload a Build Artifact
uses: actions/[email protected]
with:
name: GoRadio binaries
# A file, directory or wildcard pattern that describes what to upload
path: ./output/*
# The desired behavior if no files are found using the provided path.
if-no-files-found: error
retention-days: 7
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 'stable'
check-latest: true
cache: true
- name: Install gox
run: go install github.com/mitchellh/gox@latest
- name: Build
run: gox -output="./output/radio_{{.OS}}_{{.Arch}}" -osarch="darwin/amd64"
- name: Upload a Build Artifact
uses: actions/[email protected]
with:
name: GoRadio binaries
# A file, directory or wildcard pattern that describes what to upload
path: ./output/*
# The desired behavior if no files are found using the provided path.
if-no-files-found: error
retention-days: 7
release:
name: Create Github release from artifacts
runs-on: ubuntu-latest
needs: [build-linux-and-windows, build-macos, test]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- name: Download built binaries
uses: actions/download-artifact@v3
- name: Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
files: ./**/*