Dumb server that helps you serve files from a path via HTTP.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

103 lines
2.7 KiB

---
kind: pipeline
type: docker
name: default
platform:
os: linux
arch: amd64
workspace:
path: /drone/src
steps:
- name: prerequisites
image: golang
commands:
- mkdir -p release
- go install honnef.co/go/tools/cmd/staticcheck@latest
- go install github.com/fzipp/gocyclo/cmd/gocyclo@latest
volumes:
- name: cache
path: /go
- name: test
image: golang
commands:
- go test -v -race ./...
- go vet ./...
- staticcheck ./...
- gocyclo -over 19 $(find . -iname '*.go' -type f | grep -v /vendor/)
volumes:
- name: cache
path: /go
depends_on:
- prerequisites
- name: build-darwin
image: golang
commands:
- mkdir -p release/darwin
- GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w -X main.version=${DRONE_TAG:-latest}" -o release/darwin/dumb-http cmd/dumb-http/main.go
- tar -czf release/dumb-http-${DRONE_TAG:-latest}-darwin-amd64.tar.gz README.md -C release/darwin/ dumb-http
- GOOS=darwin GOARCH=arm64 go build -ldflags "-s -w -X main.version=${DRONE_TAG:-latest}" -o release/darwin/dumb-http cmd/dumb-http/main.go
- tar -czf release/dumb-http-${DRONE_TAG:-latest}-darwin-arm64.tar.gz README.md -C release/darwin/ dumb-http
depends_on:
- test
when:
event:
- tag
- name: build-windows
image: golang
commands:
- mkdir -p release/windows
- GOOS=windows GOARCH=amd64 go build -ldflags "-s -w -X main.version=${DRONE_TAG:-latest}" -o release/windows/dumb-http cmd/dumb-http/main.go
- tar -czf release/dumb-http-${DRONE_TAG:-latest}-windows-amd64.tar.gz README.md -C release/windows/ dumb-http
depends_on:
- test
when:
event:
- tag
- name: build-linux
image: golang
commands:
- mkdir -p release/linux
- GOOS=linux GOARCH=amd64 go build -ldflags "-s -w -X main.version=${DRONE_TAG:-latest}" -o release/linux/dumb-http cmd/dumb-http/main.go
- tar -czf release/dumb-http-${DRONE_TAG:-latest}-linux-amd64.tar.gz README.md -C release/linux/ dumb-http
- GOOS=linux GOARCH=arm64 go build -ldflags "-s -w -X main.version=${DRONE_TAG:-latest}" -o release/linux/dumb-http cmd/dumb-http/main.go
- tar -czf release/dumb-http-${DRONE_TAG:-latest}-linux-arm64.tar.gz README.md -C release/linux/ dumb-http
depends_on:
- test
when:
event:
- tag
- name: gitea-release
image: plugins/gitea-release
settings:
api_key:
from_secret: gitea_token
base_url: https://git.dcpri.me
checksum:
- sha256
files:
- release/*.tar.gz
title: Version ${DRONE_TAG/v/}
when:
event:
- tag
depends_on:
- build-linux
- build-darwin
- build-windows
volumes:
- name: cache
temp: {}
---
kind: signature
hmac: 0be535706d13718f51d54c7421346ace025f09cb6d1a7ab80650fff98453b4fa
...