2019-12-02 02:55:38 -08:00
|
|
|
language: go
|
2019-12-02 02:33:59 -08:00
|
|
|
|
|
|
|
go:
|
|
|
|
- "1.13"
|
2019-12-02 03:15:40 -08:00
|
|
|
- master
|
2019-12-02 20:56:23 -08:00
|
|
|
services:
|
|
|
|
- docker
|
2019-12-02 02:33:59 -08:00
|
|
|
script:
|
2019-12-02 20:56:23 -08:00
|
|
|
- go test -v ./cmd/nps/
|
2019-12-02 23:24:47 -08:00
|
|
|
|
2019-12-02 02:55:38 -08:00
|
|
|
before_deploy:
|
2019-12-02 09:25:21 -08:00
|
|
|
- wget https://github.com/upx/upx/releases/download/v3.95/upx-3.95-amd64_linux.tar.xz
|
|
|
|
- tar -xvf upx-3.95-amd64_linux.tar.xz
|
|
|
|
- cp upx-3.95-amd64_linux/upx ./
|
|
|
|
|
|
|
|
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go
|
2019-12-02 09:32:53 -08:00
|
|
|
|
2019-12-02 09:25:21 -08:00
|
|
|
- tar -czvf linux_amd64_client.tar.gz npc conf/npc.conf
|
|
|
|
|
|
|
|
- CGO_ENABLED=0 GOOS=linux GOARCH=386 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go
|
2019-12-02 09:32:53 -08:00
|
|
|
|
2019-12-02 09:25:21 -08:00
|
|
|
- tar -czvf linux_386_client.tar.gz npc conf/npc.conf
|
|
|
|
|
|
|
|
- CGO_ENABLED=0 GOOS=freebsd GOARCH=386 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go
|
2019-12-02 09:32:53 -08:00
|
|
|
|
2019-12-02 09:25:21 -08:00
|
|
|
- tar -czvf freebsd_386_client.tar.gz npc conf/npc.conf
|
|
|
|
|
|
|
|
- CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go
|
2019-12-02 09:32:53 -08:00
|
|
|
|
2019-12-02 09:25:21 -08:00
|
|
|
- tar -czvf freebsd_amd64_client.tar.gz npc conf/npc.conf
|
|
|
|
|
|
|
|
- CGO_ENABLED=0 GOOS=freebsd GOARCH=arm go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go
|
2019-12-02 09:32:53 -08:00
|
|
|
|
2019-12-02 09:52:20 -08:00
|
|
|
- tar -czvf freebsd_arm_client.tar.gz npc conf/npc.conf
|
2019-12-02 09:25:21 -08:00
|
|
|
|
2019-12-02 18:01:41 -08:00
|
|
|
- CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go
|
2019-12-02 09:52:20 -08:00
|
|
|
|
2019-12-02 20:56:23 -08:00
|
|
|
- tar -czvf linux_arm_v7_client.tar.gz npc conf/npc.conf
|
2019-12-02 18:01:41 -08:00
|
|
|
|
|
|
|
- CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go
|
|
|
|
|
2019-12-02 20:56:23 -08:00
|
|
|
- tar -czvf linux_arm_v6_client.tar.gz npc conf/npc.conf
|
2019-12-02 18:03:18 -08:00
|
|
|
|
2019-12-02 18:01:41 -08:00
|
|
|
- CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=5 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go
|
|
|
|
|
2019-12-02 20:56:23 -08:00
|
|
|
- tar -czvf linux_arm_v5_client.tar.gz npc conf/npc.conf
|
2019-12-02 09:25:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
- CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go
|
2019-12-02 09:32:53 -08:00
|
|
|
|
2019-12-02 09:25:21 -08:00
|
|
|
- tar -czvf linux_arm64_client.tar.gz npc conf/npc.conf
|
|
|
|
|
|
|
|
|
|
|
|
- CGO_ENABLED=0 GOOS=linux GOARCH=mips64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go
|
2019-12-02 09:32:53 -08:00
|
|
|
|
2019-12-02 09:25:21 -08:00
|
|
|
- tar -czvf linux_mips64_client.tar.gz npc conf/npc.conf
|
|
|
|
|
|
|
|
|
|
|
|
- CGO_ENABLED=0 GOOS=linux GOARCH=mips64le go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go
|
2019-12-02 09:32:53 -08:00
|
|
|
|
2019-12-02 09:25:21 -08:00
|
|
|
- tar -czvf linux_mips64le_client.tar.gz npc conf/npc.conf
|
|
|
|
|
|
|
|
|
|
|
|
- CGO_ENABLED=0 GOOS=linux GOARCH=mipsle go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go
|
2019-12-02 09:32:53 -08:00
|
|
|
|
2019-12-02 09:25:21 -08:00
|
|
|
- tar -czvf linux_mipsle_client.tar.gz npc conf/npc.conf
|
|
|
|
|
|
|
|
|
|
|
|
- CGO_ENABLED=0 GOOS=linux GOARCH=mips go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go
|
2019-12-02 09:32:53 -08:00
|
|
|
|
2019-12-02 09:25:21 -08:00
|
|
|
- tar -czvf linux_mips_client.tar.gz npc conf/npc.conf
|
|
|
|
|
|
|
|
|
|
|
|
- CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go
|
2019-12-02 09:32:53 -08:00
|
|
|
|
2019-12-02 09:25:21 -08:00
|
|
|
- tar -czvf win_386_client.tar.gz npc.exe conf/npc.conf
|
|
|
|
|
|
|
|
|
|
|
|
- CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go
|
2019-12-02 09:32:53 -08:00
|
|
|
|
2019-12-02 09:25:21 -08:00
|
|
|
- tar -czvf win_amd64_client.tar.gz npc.exe conf/npc.conf
|
|
|
|
|
|
|
|
|
|
|
|
- CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go
|
2019-12-02 09:32:53 -08:00
|
|
|
|
2019-12-02 09:25:21 -08:00
|
|
|
- tar -czvf macos_client.tar.gz npc conf/npc.conf
|
|
|
|
|
|
|
|
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go
|
2019-12-02 09:32:53 -08:00
|
|
|
|
2019-12-02 09:25:21 -08:00
|
|
|
- tar -czvf linux_amd64_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps
|
|
|
|
|
|
|
|
- CGO_ENABLED=0 GOOS=linux GOARCH=386 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go
|
2019-12-02 09:32:53 -08:00
|
|
|
|
2019-12-02 09:25:21 -08:00
|
|
|
- tar -czvf linux_386_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps
|
|
|
|
|
2019-12-02 18:03:18 -08:00
|
|
|
- CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=5 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go
|
|
|
|
|
2019-12-02 20:56:23 -08:00
|
|
|
- tar -czvf linux_arm_v5_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps
|
2019-12-02 18:03:18 -08:00
|
|
|
|
|
|
|
- CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go
|
|
|
|
|
2019-12-02 20:56:23 -08:00
|
|
|
- tar -czvf linux_arm_v6_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps
|
2019-12-02 18:03:18 -08:00
|
|
|
|
2019-12-02 18:14:06 -08:00
|
|
|
- CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go
|
2019-12-02 09:32:53 -08:00
|
|
|
|
2019-12-02 20:56:23 -08:00
|
|
|
- tar -czvf linux_arm_v7_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps
|
2019-12-02 09:25:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
- CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go
|
2019-12-02 09:32:53 -08:00
|
|
|
|
2019-12-02 09:25:21 -08:00
|
|
|
- tar -czvf linux_arm64_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps
|
|
|
|
|
|
|
|
|
2019-12-02 09:52:20 -08:00
|
|
|
- CGO_ENABLED=0 GOOS=freebsd GOARCH=arm go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go
|
|
|
|
|
|
|
|
- tar -czvf freebsd_arm_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps
|
|
|
|
|
2019-12-02 09:25:21 -08:00
|
|
|
|
|
|
|
- CGO_ENABLED=0 GOOS=freebsd GOARCH=386 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go
|
2019-12-02 09:32:53 -08:00
|
|
|
|
2019-12-02 09:25:21 -08:00
|
|
|
- tar -czvf freebsd_386_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps
|
|
|
|
|
|
|
|
|
|
|
|
- CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go
|
2019-12-02 09:32:53 -08:00
|
|
|
|
2019-12-02 09:25:21 -08:00
|
|
|
- tar -czvf freebsd_amd64_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- CGO_ENABLED=0 GOOS=linux GOARCH=mips go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go
|
2019-12-02 09:32:53 -08:00
|
|
|
|
2019-12-02 09:25:21 -08:00
|
|
|
- tar -czvf linux_mips_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps
|
|
|
|
|
|
|
|
|
|
|
|
- CGO_ENABLED=0 GOOS=linux GOARCH=mips64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go
|
2019-12-02 09:32:53 -08:00
|
|
|
|
2019-12-02 09:25:21 -08:00
|
|
|
- tar -czvf linux_mips64_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps
|
|
|
|
|
|
|
|
|
|
|
|
- CGO_ENABLED=0 GOOS=linux GOARCH=mips64le go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go
|
2019-12-02 09:32:53 -08:00
|
|
|
|
2019-12-02 09:25:21 -08:00
|
|
|
- tar -czvf linux_mips64le_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps
|
|
|
|
|
|
|
|
|
|
|
|
- CGO_ENABLED=0 GOOS=linux GOARCH=mipsle go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go
|
2019-12-02 09:32:53 -08:00
|
|
|
|
2019-12-02 09:25:21 -08:00
|
|
|
- tar -czvf linux_mipsle_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go
|
2019-12-02 09:32:53 -08:00
|
|
|
|
2019-12-02 09:25:21 -08:00
|
|
|
- tar -czvf macos_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps
|
|
|
|
|
|
|
|
|
|
|
|
- CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go
|
2019-12-02 09:32:53 -08:00
|
|
|
|
2019-12-02 09:25:21 -08:00
|
|
|
- tar -czvf win_amd64_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps.exe
|
|
|
|
|
|
|
|
|
|
|
|
- CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go
|
2019-12-02 09:32:53 -08:00
|
|
|
|
2019-12-02 09:25:21 -08:00
|
|
|
- tar -czvf win_386_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps.exe
|
2019-12-02 04:28:03 -08:00
|
|
|
|
2019-12-02 23:24:47 -08:00
|
|
|
- export VERSION=0.24.2
|
|
|
|
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
|
|
|
|
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
|
|
|
|
- sudo apt-get update
|
|
|
|
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
|
|
|
|
- docker --version
|
|
|
|
- git clone https://github.com/cnlh/spksrc.git ~/spksrc
|
|
|
|
- mkdir ~/spksrc/nps && cp -rf ./* ~/spksrc/nps/
|
|
|
|
- docker run -itd --name spksrc --env VERSION=$VERSION -v ~/spksrc:/spksrc synocommunity/spksrc /bin/bash
|
|
|
|
- docker exec -it spksrc /bin/bash -c 'cd /spksrc && make setup && cd /spksrc/spk/npc && make'
|
|
|
|
- cp ~/spksrc/packages/npc_noarch-all_$VERSION-1.spk ./npc_$VERSION.spk
|
|
|
|
|
2019-12-02 23:13:45 -08:00
|
|
|
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
|
|
|
|
- export DOCKER_CLI_EXPERIMENTAL=enabled
|
|
|
|
- docker run --rm --privileged docker/binfmt:66f9012c56a8316f9244ffd7622d7c21c1f6f28d
|
|
|
|
- docker buildx create --use --name mybuilder
|
|
|
|
- docker buildx build --tag ffdfgdfg/nps:$VERSION --output type=image,push=true --file Dockerfile.nps --platform=linux/amd64,linux/arm64,linux/386,linux/arm .
|
|
|
|
- docker buildx build --tag ffdfgdfg/npc:$VERSION --output type=image,push=true --file Dockerfile.npc --platform=linux/amd64,linux/arm64,linux/386,linux/arm .
|
2019-12-02 02:55:38 -08:00
|
|
|
|
|
|
|
deploy:
|
|
|
|
provider: releases
|
2019-12-02 05:15:43 -08:00
|
|
|
api_key:
|
|
|
|
secure: ${TOKEN}
|
2019-12-02 02:55:38 -08:00
|
|
|
skip_cleanup: true
|
|
|
|
file:
|
2019-12-02 09:30:06 -08:00
|
|
|
- freebsd_386_client.tar.gz
|
|
|
|
- freebsd_386_server.tar.gz
|
|
|
|
- freebsd_amd64_client.tar.gz
|
|
|
|
- freebsd_amd64_server.tar.gz
|
2019-12-02 09:52:20 -08:00
|
|
|
- freebsd_arm_client.tar.gz
|
|
|
|
- freebsd_arm_server.tar.gz
|
2019-12-02 09:30:06 -08:00
|
|
|
- linux_386_client.tar.gz
|
|
|
|
- linux_386_server.tar.gz
|
|
|
|
- linux_amd64_client.tar.gz
|
|
|
|
- linux_amd64_server.tar.gz
|
|
|
|
- linux_arm64_client.tar.gz
|
|
|
|
- linux_arm64_server.tar.gz
|
2019-12-02 20:56:23 -08:00
|
|
|
- linux_arm_v5_client.tar.gz
|
|
|
|
- linux_arm_v6_client.tar.gz
|
|
|
|
- linux_arm_v7_client.tar.gz
|
|
|
|
- linux_arm_v5_server.tar.gz
|
|
|
|
- linux_arm_v6_server.tar.gz
|
|
|
|
- linux_arm_v7_server.tar.gz
|
2019-12-02 09:30:06 -08:00
|
|
|
- linux_mips64le_client.tar.gz
|
|
|
|
- linux_mips64le_server.tar.gz
|
|
|
|
- linux_mips64_client.tar.gz
|
|
|
|
- linux_mips64_server.tar.gz
|
|
|
|
- linux_mipsle_client.tar.gz
|
|
|
|
- linux_mipsle_server.tar.gz
|
|
|
|
- linux_mips_client.tar.gz
|
|
|
|
- linux_mips_server.tar.gz
|
|
|
|
- macos_client.tar.gz
|
|
|
|
- macos_server.tar.gz
|
|
|
|
- win_386_client.tar.gz
|
|
|
|
- win_386_server.tar.gz
|
|
|
|
- win_amd64_client.tar.gz
|
|
|
|
- win_amd64_server.tar.gz
|
2019-12-02 22:13:32 -08:00
|
|
|
- npc_$VERSION.spk
|
2019-12-02 06:20:33 -08:00
|
|
|
on:
|
|
|
|
tags: true
|
|
|
|
all_branches: true
|