--- kind: pipeline name: test platform: os: linux arch: amd64 steps: - name: staticcheck image: golang:1.14 commands: - go run honnef.co/go/tools/cmd/staticcheck ./... volumes: - name: gopath path: /go - name: lint image: golang:1.14 commands: - go run golang.org/x/lint/golint -set_exit_status ./... volumes: - name: gopath path: /go - name: vet image: golang:1.14 commands: - go vet ./... volumes: - name: gopath path: /go - name: test image: golang:1.14 commands: - go test -race -coverprofile=coverage.txt -covermode=atomic ./... volumes: - name: gopath path: /go - name: coverage image: plugins/codecov settings: files: - coverage.txt token: from_secret: codecov_token volumes: - name: gopath temp: {} trigger: ref: - refs/heads/master - refs/tags/** - refs/pull/** --- kind: pipeline name: build-binaries platform: os: linux arch: amd64 steps: - name: build image: techknowlogick/xgo:go-1.14.x commands: - "[ -z \"${DRONE_TAG}\" ] && BUILD_VERSION=${DRONE_COMMIT_SHA:0:8} || BUILD_VERSION=${DRONE_TAG##v}" - mkdir -p release/ - cd cmd/github-releases-notifier && xgo -ldflags "-s -w -X main.version=$BUILD_VERSION" -tags netgo -targets 'linux/amd64,linux/arm-6,linux/arm64' -out github-releases-notifier . - mv /build/* /drone/src/release/ - name: executable image: alpine commands: - $(find release/ -executable -type f | grep github-releases-notifier-linux-amd64) --help - name: compress image: alpine commands: - apk add upx - find release/ -maxdepth 1 -executable -type f -exec upx {} \; - ls -lh release/ - name: checksum image: alpine commands: - cd release/ && sha256sum * > sha256sum.txt - name: publish image: plugins/github-release settings: api_key: from_secret: github_token files: - release/* note: CHANGELOG.md overwrite: true title: ${DRONE_TAG} when: ref: - refs/tags/** trigger: ref: - refs/heads/master - refs/tags/** - refs/pull/** depends_on: - test --- kind: pipeline name: notifications platform: os: linux arch: amd64 steps: - name: matrix image: plugins/matrix settings: homeserver: from_secret: matrix_homeserver password: from_secret: matrix_password roomid: from_secret: matrix_roomid template: "Status: **{{ build.status }}**
Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}
Message: {{ build.message }}" username: from_secret: matrix_username when: status: - success - failure trigger: ref: - refs/heads/master - refs/tags/** status: - success - failure depends_on: - build-binaries --- kind: signature hmac: 5ca11cf4dc76a28155711c9665abeab4a3e61a5bd8c819588a76ba8baef16cfe ...