From aee653dbde0859a9477af9cdcdbf6088a45f8bdc Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Sat, 26 Mar 2022 12:11:52 +0100 Subject: [PATCH] updated .drone.yml --- .drone.yml | 118 +++++++++++++---------------------------------------- 1 file changed, 29 insertions(+), 89 deletions(-) diff --git a/.drone.yml b/.drone.yml index cc2b5d8..f98a945 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,64 +1,47 @@ --- 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/qrz/build - ---- -kind: pipeline -type: docker -name: default-linux-amd64 +environment: + GOOS: linux + GOARCH: amd64 + GOOPTIONS: -mod=vendor + SRCFILES: cmd/qrz/*.go + PROJECTNAME: qrz steps: - name: build image: golang commands: - - ./ci-build.sh build - environment: - GOOS: linux - GOARCH: amd64 - volumes: - - name: build - path: /build - -volumes: - - name: build - host: - path: /tmp/qrz/build - -depends_on: - - cleanup-before + - go build -o $PROJECTNAME $GOOPTIONS $SRCFILES + when: + event: + exclude: + - tag --- kind: pipeline type: docker -name: gitea-release +name: gitea-release-linux-amd64 + +environment: + GOOS: linux + GOARCH: amd64 + GOOPTIONS: -mod=vendor + SRCFILES: cmd/qrz/*.go + PROJECTNAME: qrz steps: - - name: move - image: alpine + - name: build + image: golang commands: - - mv build/* ./ - volumes: - - name: build - path: /drone/src/build + - 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: @@ -70,49 +53,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/qrz/build - -depends_on: - - default-linux-amd64 - ---- -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/qrz/build - -depends_on: - - gitea-release + event: + - tag