Skip to content

Commit 59774fc

Browse files
authored
Bring our CI into 2020 (#12)
* Switch CI to Drone * Fix a CI complaint * Embed version into builds * Test if the version is being detected * Success, remove debug print
1 parent 909309e commit 59774fc

File tree

3 files changed

+37
-41
lines changed

3 files changed

+37
-41
lines changed

.drone.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
kind: pipeline
2+
type: docker
3+
name: build
4+
5+
steps:
6+
- name: lint
7+
image: golang:1.14-alpine
8+
commands:
9+
- go get golang.org/x/lint/golint github.com/securego/gosec/cmd/gosec
10+
- test -z $(gofmt -l .)
11+
- golint -set_exit_status ./...
12+
- gosec -quiet ./...
13+
14+
- name: prepare and build
15+
image: golang:1.14-alpine
16+
commands:
17+
- go get github.com/mitchellh/gox
18+
- go get -v -d ./...
19+
- mkdir -p dist
20+
- arch=$(go tool dist list |
21+
tr "\n" " " |
22+
sed -r "s~((android|nacl)/\w+|darwin/arm(64)?)~~g" |
23+
xargs)
24+
- version=$(if [ -z "$DRONE_TAG" ]; then echo $DRONE_COMMIT; else echo $DRONE_TAG; fi)
25+
- gox -parallel=16 -osarch="$arch" -output="dist/{{.Dir}}_{{.OS}}_{{.Arch}}" -ldflags "-X main.version=$version" ./...
26+
environment:
27+
CGO_ENABLED: 0
28+
29+
- name: release binaries
30+
image: plugins/github-release
31+
settings:
32+
api_key:
33+
from_secret: github_token
34+
files: dist/*
35+
when:
36+
event: tag

Jenkinsfile

-40
This file was deleted.

cmd/protoplex/protoplex.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func main() {
4040
socks4 := app.Flag("socks4", "The SOCKS4 server address").String()
4141
// stRelay := flag.String("strelay", "", "The Syncthing Relay server address")
4242

43-
app.Parse(os.Args[1:])
43+
_, _ = app.Parse(os.Args[1:])
4444

4545
if *version {
4646
printVersion()

0 commit comments

Comments
 (0)