updated .drone.yml
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Paul Lecuq 2022-03-25 11:59:29 +01:00
parent 8aff3b10f1
commit bedf286fac

View File

@ -1,89 +1,52 @@
---
kind: pipeline
type: docker
name: cleanup-before
name: build-linux-amd64
steps:
- name: clean
image: alpine
commands:
- rm -rf /build/*
volumes:
- name: build
path: /build
when:
event: tag
volumes:
- name: build
host:
path: /tmp/go-aptproxy/build
---
kind: pipeline
type: docker
name: default-linux-amd64
steps:
- name: build
image: golang
commands:
- ./ci-build.sh build
environment:
GOOS: linux
GOARCH: amd64
volumes:
- name: build
path: /build
GOOPTIONS: -mod=vendor
SRCFILES: cmd/go-aptproxy/*.go
PROJECTNAME: go-aptproxy
volumes:
steps:
- name: build
host:
path: /tmp/go-aptproxy/build
depends_on:
- cleanup-before
image: golang
environment:
VERSION: dev
commands:
- go generate $SRCFILES
- go build -o $PROJECTNAME $GOOPTIONS $SRCFILES
when:
event:
exclude:
- tag
---
kind: pipeline
type: docker
name: default-linux-arm64
name: gitea-release-linux-amd64
environment:
GOOS: linux
GOARCH: amd64
GOOPTIONS: -mod=vendor
SRCFILES: cmd/go-aptproxy/*.go
PROJECTNAME: go-aptproxy
steps:
- name: build
image: golang
commands:
- ./ci-build.sh build
environment:
GOOS: linux
GOARCH: arm64
volumes:
- name: build
path: /build
volumes:
- name: build
host:
path: /tmp/go-aptproxy/build
depends_on:
- cleanup-before
---
kind: pipeline
type: docker
name: gitea-release
steps:
- name: move
image: alpine
commands:
- mv build/* ./
volumes:
- name: build
path: /drone/src/build
- 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
event:
- tag
- name: release
image: plugins/gitea-release
settings:
@ -95,50 +58,6 @@ steps:
- sha256
- sha512
title: VERSION
volumes:
- name: build
path: /drone/src/build
when:
event: tag
- name: ls
image: alpine
commands:
- find .
volumes:
- name: build
path: /drone/src/build
when:
event: tag
volumes:
- name: build
host:
path: /tmp/go-aptproxy/build
depends_on:
- default-linux-amd64
- default-linux-arm64
---
kind: pipeline
type: docker
name: cleanup-after
steps:
- name: clean
image: alpine
commands:
- rm -rf /build/*
volumes:
- name: build
path: /build
when:
event: tag
volumes:
- name: build
host:
path: /tmp/go-aptproxy/build
depends_on:
- gitea-release
event:
- tag