This repository was archived by the owner on Jun 6, 2021. It is now read-only.
Repository navigation
132 lines (115 loc) · 3.06 KB
/
Copy pathtag.yml
File metadata and controls
132 lines (115 loc) · 3.06 KB
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: Release
on:
push:
tags:
- '**'
jobs:
dynamic:
name: Build Dynamic
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- uses: actions/setup-node@v1
- name: Build
run: |
go get -u github.com/gobuffalo/packr/v2/packr2
PATH=$PATH:$(go env GOPATH)/bin make
- name: Prepare artifact upload
run: |
set -e
mkdir build
cp -r README.md LICENSE icon.svg wtfd build/
- name: Upload artifacts
uses: actions/upload-artifact@master
with:
name: wtfd-dynamic
path: build
static:
name: Build Static
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- uses: actions/setup-node@v1
- name: Install Dependencies
run: |
set -e
sudo apt-get update && sudo apt-get -y install musl-tools
- name: Build (with musl)
env:
CC: musl-gcc
run: |
set -e
pushd frontend
npm install
npx webpack --config webpack.prod.js
popd
go build -ldflags '-linkmode external -extldflags "-static"' -v cmd/wtfd.go
strip wtfd
- name: Prepare artifact upload
run: |
set -e
mkdir build
cp -r LICENSE README.md wtfd icon.svg html build/
- name: Upload artifacts
uses: actions/upload-artifact@master
with:
name: wtfd-static
path: build
test:
name: Run Test
runs-on: ubuntu-latest
needs: [dynamic, static]
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Test
run: go test -race -coverprofile=coverage.txt -covermode=atomic ./...
release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs: [test]
steps:
- name: Install Dependencies
run: |
set -e
sudo apt-get update && sudo apt-get install -y zip
- name: Download Dynamic
uses: actions/download-artifact@master
with:
name: wtfd-dynamic
path: dynamic
- name: Download Static
uses: actions/download-artifact@master
with:
name: wtfd-static
path: static
- name: Zip
run: |
set -e
zip -r wtfd-static.zip static/.
zip -r wtfd-dynamic.zip dynamic/.
- name: Upload
uses: softprops/action-gh-release@v1
with:
files: |
wtfd-static.zip
wtfd-dynamic.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}