re-generate drone config

This commit is contained in:
Robert Kaussow 2021-09-12 21:50:32 +02:00
parent 4dbc8a9d75
commit d797a814c4
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
1 changed files with 63 additions and 86 deletions

View File

@ -1,114 +1,103 @@
--- ---
image_pull_secrets:
- docker_config
kind: pipeline kind: pipeline
name: test name: test
platform: platform:
os: linux
arch: amd64 arch: amd64
os: linux
steps: steps:
- name: staticcheck - commands:
image: golang:1.16
commands:
- go run honnef.co/go/tools/cmd/staticcheck ./... - go run honnef.co/go/tools/cmd/staticcheck ./...
image: golang:1.16
name: staticcheck
volumes: volumes:
- name: gopath - name: gopath
path: /go path: /go
- commands:
- name: lint
image: golang:1.16
commands:
- go run golang.org/x/lint/golint -set_exit_status ./... - go run golang.org/x/lint/golint -set_exit_status ./...
image: golang:1.16
name: lint
volumes: volumes:
- name: gopath - name: gopath
path: /go path: /go
- commands:
- name: vet
image: golang:1.16
commands:
- go vet ./... - go vet ./...
volumes:
- name: gopath
path: /go
- name: test
image: golang:1.16 image: golang:1.16
commands: name: vet
- go test -race -coverprofile=coverage.txt -covermode=atomic ./...
volumes: volumes:
- name: gopath - name: gopath
path: /go path: /go
- commands:
- name: coverage - go test -race -coverprofile=coverage.txt -covermode=atomic ./...
image: plugins/codecov image: golang:1.16
name: test
volumes:
- name: gopath
path: /go
- image: plugins/codecov
name: coverage
settings: settings:
files: files:
- coverage.txt - coverage.txt
token: token:
from_secret: codecov_token from_secret: codecov_token
volumes:
- name: gopath
temp: {}
image_pull_secrets:
- docker_config
trigger: trigger:
ref: ref:
- refs/heads/main - refs/heads/main
- refs/tags/** - refs/tags/**
- refs/pull/** - refs/pull/**
volumes:
- name: gopath
temp: {}
--- ---
depends_on:
- test
image_pull_secrets:
- docker_config
kind: pipeline kind: pipeline
name: build-binaries name: build-binaries
platform: platform:
os: linux
arch: amd64 arch: amd64
os: linux
steps: steps:
- name: build - commands:
image: techknowlogick/xgo:go-1.16.x - '[ -z "${DRONE_TAG}" ] && BUILD_VERSION=${DRONE_COMMIT_SHA:0:8} || BUILD_VERSION=${DRONE_TAG##v}'
commands:
- "[ -z \"${DRONE_TAG}\" ] && BUILD_VERSION=${DRONE_COMMIT_SHA:0:8} || BUILD_VERSION=${DRONE_TAG##v}"
- mkdir -p release/ - mkdir -p release/
- cd cmd/url-parser && xgo -ldflags "-s -w -X main.version=$BUILD_VERSION" -tags netgo -targets 'linux/amd64,linux/arm-6,linux/arm-7,linux/arm64' -out url-parser . - cd cmd/url-parser && xgo -ldflags "-s -w -X main.version=$BUILD_VERSION" -tags
netgo -targets 'linux/amd64,linux/arm-6,linux/arm-7,linux/arm64' -out url-parser
.
- mv /build/* /drone/src/release/ - mv /build/* /drone/src/release/
- ls -l /drone/src/release/ - ls -l /drone/src/release/
image: techknowlogick/xgo:go-1.16.x
- name: executable name: build
image: alpine - commands:
commands:
- $(find release/ -executable -type f | grep url-parser-linux-amd64) --help - $(find release/ -executable -type f | grep url-parser-linux-amd64) --help
- name: compress
image: alpine image: alpine
commands: name: executable
- commands:
- apk add upx - apk add upx
- find release/ -maxdepth 1 -executable -type f -exec upx {} \; - find release/ -maxdepth 1 -executable -type f -exec upx {} \;
- ls -lh release/ - ls -lh release/
- name: checksum
image: alpine image: alpine
commands: name: compress
- commands:
- cd release/ && sha256sum * > sha256sum.txt - cd release/ && sha256sum * > sha256sum.txt
image: alpine
- name: changelog-generate name: checksum
image: thegeeklab/git-chglog - commands:
commands:
- git fetch -tq - git fetch -tq
- git-chglog --no-color --no-emoji -o CHANGELOG.md ${DRONE_TAG:---next-tag unreleased unreleased} - git-chglog --no-color --no-emoji -o CHANGELOG.md ${DRONE_TAG:---next-tag unreleased
unreleased}
- name: changelog-format image: thegeeklab/git-chglog
image: thegeeklab/alpine-tools name: changelog-generate
commands: - commands:
- prettier CHANGELOG.md - prettier CHANGELOG.md
- prettier -w CHANGELOG.md - prettier -w CHANGELOG.md
image: thegeeklab/alpine-tools
- name: publish name: changelog-format
image: plugins/github-release - image: plugins/github-release
name: publish
settings: settings:
api_key: api_key:
from_secret: github_token from_secret: github_token
@ -120,30 +109,24 @@ steps:
when: when:
ref: ref:
- refs/tags/** - refs/tags/**
image_pull_secrets:
- docker_config
trigger: trigger:
ref: ref:
- refs/heads/main - refs/heads/main
- refs/tags/** - refs/tags/**
- refs/pull/** - refs/pull/**
depends_on:
- test
--- ---
depends_on:
- build-binaries
image_pull_secrets:
- docker_config
kind: pipeline kind: pipeline
name: notifications name: notifications
platform: platform:
os: linux
arch: amd64 arch: amd64
os: linux
steps: steps:
- name: matrix - image: plugins/matrix
image: plugins/matrix name: matrix
settings: settings:
homeserver: homeserver:
from_secret: matrix_homeserver from_secret: matrix_homeserver
@ -151,17 +134,15 @@ steps:
from_secret: matrix_password from_secret: matrix_password
roomid: roomid:
from_secret: matrix_roomid from_secret: matrix_roomid
template: "Status: **{{ build.status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}<br/> Message: {{ build.message }}" template: 'Status: **{{ build.status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name
}}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}<br/> Message:
{{ build.message }}'
username: username:
from_secret: matrix_username from_secret: matrix_username
when: when:
status: status:
- success - success
- failure - failure
image_pull_secrets:
- docker_config
trigger: trigger:
ref: ref:
- refs/heads/main - refs/heads/main
@ -169,12 +150,8 @@ trigger:
status: status:
- success - success
- failure - failure
depends_on:
- build-binaries
--- ---
kind: signature kind: signature
hmac: 7fdbba67121342a2cc89d474cba472b10a0dc466f40ca82fd2cfa8414ae78f54 hmac: ee57fc59656c8ed6edddb3fd63aab7119702447bc8f6185cc4798a21dbac5f5e
... ...