-
Notifications
You must be signed in to change notification settings - Fork 23
142 lines (120 loc) · 3.59 KB
/
go-dev.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
133
134
135
136
137
138
139
140
141
142
name: Go
on:
push:
branches:
- master
tags:
- '*'
pull_request:
branches:
- master
jobs:
build-linux:
name: Build & Test on ubuntu-latest
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.19
uses: actions/setup-go@v3
with:
go-version: 1.19
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Get dependencies
run: go get -v -t -d ./...
- name: Build
run: go build -v .
- name: Test
run: |
go test -race -coverprofile=coverage.txt -covermode=atomic ./...
bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }}
- name: Prep Release Directory
if: startsWith(github.ref, 'refs/tags/')
run: |
mkdir poryscript-linux
cp poryscript poryscript-linux
cp font_config.json poryscript-linux
cp CHANGELOG.md poryscript-linux
cp README.md poryscript-linux
- name: Bundle Release Directory
if: startsWith(github.ref, 'refs/tags/')
uses: montudor/action-zip@v0.1.0
with:
args: zip -r poryscript-linux.zip poryscript-linux
- name: Create Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: poryscript-linux.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-mac:
name: Build & Test on macos-latest
runs-on: macos-latest
steps:
- name: Set up Go 1.19
uses: actions/setup-go@v3
with:
go-version: 1.19
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Get dependencies
run: go get -v -t -d ./...
- name: Build
run: go build -v .
- name: Test
run: go test ./...
- name: Prep Release Directory
if: startsWith(github.ref, 'refs/tags/')
run: |
mkdir poryscript-mac
cp poryscript poryscript-mac
cp font_config.json poryscript-mac
cp CHANGELOG.md poryscript-mac
cp README.md poryscript-mac
- name: Bundle Release Directory
if: startsWith(github.ref, 'refs/tags/')
run: zip -r poryscript-mac.zip poryscript-mac
- name: Create Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: poryscript-mac.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-windows:
name: Build & Test on windows-latest
runs-on: windows-latest
steps:
- name: Set up Go 1.19
uses: actions/setup-go@v3
with:
go-version: 1.19
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Get dependencies
run: go get -v -t -d ./...
- name: Build
run: go build -v .
- name: Test
run: go test ./...
- name: Prep Release Directory
if: startsWith(github.ref, 'refs/tags/')
run: |
mkdir poryscript-windows
cp poryscript.exe poryscript-windows
cp font_config.json poryscript-windows
cp CHANGELOG.md poryscript-windows
cp README.md poryscript-windows
- name: Bundle Release Directory
if: startsWith(github.ref, 'refs/tags/')
run: powershell.exe -Command "Compress-Archive -Path poryscript-windows -DestinationPath poryscript-windows.zip"
- name: Create Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: poryscript-windows.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}