-
Notifications
You must be signed in to change notification settings - Fork 2
109 lines (98 loc) · 2.74 KB
/
release.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
name: Release
on:
push:
tags:
- "v*.*.*"
jobs:
build:
name: Build
# https://github.com/actions/virtual-environments/
runs-on: ubuntu-latest
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v3
# https://github.com/marketplace/actions/setup-go-environment
- name: 🔧 Setup go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- name: 🍳 Build
run: bash build.sh
# Test binary
- name: 🌡️ Test
run: chmod +x go-andotp-linux-x86_64 && ./go-andotp-linux-x86_64 -h
# Upload binaries
# https://github.com/marketplace/actions/upload-a-build-artifact
- name: 📤 Upload
uses: actions/upload-artifact@v3
with:
name: go-andotp
path: go-andotp*
retention-days: 1
test-linux:
name: Test Linux
needs: build
runs-on: ubuntu-latest
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v3
# Download binaries
# https://github.com/marketplace/actions/download-a-build-artifact
- name: 📥 Download
uses: actions/download-artifact@v3
with:
name: go-andotp
# Test binary
- name: 🌡️ Test
run: chmod +x go-andotp-linux-x86_64 && ./go-andotp-linux-x86_64 -h
test-macos:
name: Test macOS
needs: build
runs-on: macos-latest
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v3
- name: 📥 Download
uses: actions/download-artifact@v3
with:
name: go-andotp
# Test binary
- name: 🌡️ Test
run: chmod +x go-andotp-macos-x86_64 && ./go-andotp-macos-x86_64 -h
test-windows:
name: Test Windows
needs: build
runs-on: windows-latest
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v3
- name: 📥 Download
uses: actions/download-artifact@v3
with:
name: go-andotp
# Test binary
- name: 🌡️ Test
run: .\go-andotp-windows-x86_64.exe -h
release:
name: Release
needs: [test-linux, test-macos, test-windows]
runs-on: ubuntu-latest
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v3
- name: 📥 Download
uses: actions/download-artifact@v3
with:
name: go-andotp
# Release, upload files
# https://github.com/marketplace/actions/gh-release
- name: ✨ Release
uses: softprops/action-gh-release@v1
with:
files: |
go-andotp-linux-x86_64
go-andotp-linux-arm64
go-andotp-macos-x86_64
go-andotp-macos-arm64
go-andotp-windows-x86_64.exe
go-andotp-windows-arm64.exe