Skip to content
This repository was archived by the owner on Mar 19, 2021. It is now read-only.

Commit 962febf

Browse files
committed
test drone
1 parent e3e3afa commit 962febf

File tree

4 files changed

+42
-3
lines changed

4 files changed

+42
-3
lines changed

.drone.yml

+25-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,31 @@ kind: pipeline
22
name: default
33

44
steps:
5-
- name: test
5+
- name: frontend
6+
image: node
7+
commands:
8+
- cd frontend
9+
- npm ci --registry=https://registry.npm.taobao.org
10+
- npm run build
11+
12+
- name: backend
613
image: golang
714
commands:
8-
- sh build.sh
15+
- sh build_go.sh
16+
17+
- name: gitea_release
18+
image: plugins/gitea-release
19+
settings:
20+
base_url:
21+
from_secret: gitea_url
22+
api_key:
23+
from_secret: gitea_token
24+
checksum:
25+
- sha256
26+
files:
27+
- Robot_Monitor_Web_linux.zip
28+
- Robot_Monitor_Web_mac.zip
29+
- Robot_Monitor_Web_windows.zip
30+
when:
31+
event: tag
932

build_go.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/sh
2+
cp main.go main.go.org
3+
sed -i 's/http.Dir(\".\/frontend\/dist\/\")/assetFS()/g' main.go
4+
go get github.com/go-bindata/go-bindata/...
5+
go get github.com/elazarl/go-bindata-assetfs/...
6+
go-bindata-assetfs -prefix frontend frontend/dist/...
7+
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o Robot_Monitor_Web_linux
8+
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="-w -s" -o Robot_Monitor_Web_mac
9+
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags="-w -s" -o Robot_Monitor_Web_windows.exe
10+
zip Robot_Monitor_Web_linux.zip Robot_Monitor_Web_linux
11+
zip Robot_Monitor_Web_mac.zip Robot_Monitor_Web_mac
12+
zip Robot_Monitor_Web_windows.zip Robot_Monitor_Web_windows.exe
13+
rm -f main.go
14+
mv main.go.org main.go

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ require (
88
github.com/go-bindata/go-bindata v3.1.2+incompatible // indirect
99
github.com/gorilla/websocket v1.4.2
1010
go.bug.st/serial.v1 v0.0.0-20191202182710-24a6610f0541
11-
golang.org/x/sys v0.0.0-20200519105757-fe76b779f299 // indirect
11+
golang.org/x/sys v0.0.0-20200620081246-981b61492c35 // indirect
1212
)

go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ go.bug.st/serial.v1 v0.0.0-20191202182710-24a6610f0541 h1:eQfoPfT+gNSh63t/oKanQl
1111
go.bug.st/serial.v1 v0.0.0-20191202182710-24a6610f0541/go.mod h1:dRSl/CVCTf56CkXgJMDOdSwNfo2g1orOGE/gBGdvjZw=
1212
golang.org/x/sys v0.0.0-20200519105757-fe76b779f299 h1:DYfZAGf2WMFjMxbgTjaC+2HC7NkNAQs+6Q8b9WEB/F4=
1313
golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
14+
golang.org/x/sys v0.0.0-20200620081246-981b61492c35 h1:wb/9mP8eUAmHfkM8RmpeLq6nUA7c2i5+bQOtcDftjaE=
15+
golang.org/x/sys v0.0.0-20200620081246-981b61492c35/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=

0 commit comments

Comments
 (0)