go-aptproxy/.drone.yml
Paul Lecuq 68ce22a4f0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
updated .drone.yml
2022-07-11 16:48:23 +02:00

103 lines
2.0 KiB
YAML

---
kind: pipeline
type: docker
name: build-linux-amd64
environment:
GOOS: linux
GOARCH: amd64
GOOPTIONS: -mod=vendor
SRCFILES: cmd/go-aptproxy/*.go
PROJECTNAME: go-aptproxy
steps:
- name: build
image: golang
environment:
VERSION: dev
commands:
- go generate $SRCFILES
- go build -o $PROJECTNAME $GOOPTIONS $SRCFILES
when:
event:
exclude:
- tag
---
kind: pipeline
type: docker
name: build-linux-arm64
environment:
GOOS: linux
GOARCH: arm64
GOOPTIONS: -mod=vendor
SRCFILES: cmd/go-aptproxy/*.go
PROJECTNAME: go-aptproxy
steps:
- name: build
image: golang
environment:
VERSION: dev
commands:
- go generate $SRCFILES
- go build -o $PROJECTNAME $GOOPTIONS $SRCFILES
when:
event:
exclude:
- tag
---
kind: pipeline
type: docker
name: gitea-release
environment:
GOOS: linux
GOOPTIONS: -mod=vendor
SRCFILES: cmd/go-aptproxy/*.go
PROJECTNAME: go-aptproxy
steps:
- name: build-amd64
image: golang
environment:
GOARCH: amd64
commands:
- export VERSION=$DRONE_TAG
- go generate $SRCFILES
- go build -o $PROJECTNAME $GOOPTIONS $SRCFILES
- tar -czvf $PROJECTNAME-$DRONE_TAG-$GOOS-$GOARCH.tar.gz $PROJECTNAME
- echo $PROJECTNAME $DRONE_TAG > VERSION
when:
event:
- tag
- name: build-arm64
image: golang
environment:
GOARCH: arm64
commands:
- export VERSION=$DRONE_TAG
- go generate $SRCFILES
- go build -o $PROJECTNAME $GOOPTIONS $SRCFILES
- tar -czvf $PROJECTNAME-$DRONE_TAG-$GOOS-$GOARCH.tar.gz $PROJECTNAME
- echo $PROJECTNAME $DRONE_TAG > VERSION
when:
event:
- tag
- name: release
image: plugins/gitea-release
settings:
base_url: https://git.paulbsd.com
api_key:
from_secret: gitea_token
files: "*.tar.gz"
checksum:
- sha256
- sha512
title: VERSION
when:
event:
- tag