From c515a891a3f0f826d3a49e322c52dca88a56a3d6 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sun, 20 Sep 2020 23:26:42 +0200 Subject: [PATCH] fix versioning --- .drone.jsonnet | 25 ++++++++++++++++---- .drone.yml | 23 ++++++++++++++---- .github/settings.yml | 55 ++++++++++++++++++++++++++++++++++++++++++++ README.md | 4 ++-- 4 files changed, 96 insertions(+), 11 deletions(-) create mode 100644 .github/settings.yml diff --git a/.drone.jsonnet b/.drone.jsonnet index 8cd26df..0c1467b 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -83,10 +83,9 @@ local PipelineBuildBinaries = { 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}', + '[ -z "$${DRONE_TAG}" ] && BUILD_VERSION=$${DRONE_COMMIT_SHA:0:8} || BUILD_VERSION=$${DRONE_TAG##v}', 'mkdir -p release/', - "cd cmd/drone-github-comment && xgo -ldflags \"-s -w -X main.Version=$BUILD_VERSION\" -tags netgo -targets 'linux/amd64,linux/arm-6,linux/arm64' -out drone-github-comment .", - 'ls -la /build/', + "cd cmd/drone-github-comment && xgo -ldflags \"-s -w -X main.Version=$$BUILD_VERSION\" -tags netgo -targets 'linux/amd64,linux/arm-6,linux/arm64' -out drone-github-comment .", 'mv /build/* /drone/src/release/', ], }, @@ -113,6 +112,24 @@ local PipelineBuildBinaries = { 'cd release/ && sha256sum * > sha256sum.txt', ], }, + { + name: 'publish', + image: 'plugins/github-release', + settings: { + overwrite: true, + api_key: { + from_secret: 'github_token', + }, + files: ['release/*'], + title: '${DRONE_TAG}', + note: 'CHANGELOG.md', + }, + when: { + ref: [ + 'refs/tags/**', + ], + }, + }, ], depends_on: [ 'test', @@ -241,7 +258,7 @@ local PipelineNotifications = { from_secret: 'docker_username', }, PUSHRM_FILE: 'README.md', - PUSHRM_SHORT: 'Drone CI - Plugin to add comments to GitHub Issues/PRs', + PUSHRM_SHORT: 'GitHub Comment - Drone plugin to add comments to GitHub Issues/PRs', PUSHRM_TARGET: 'thegeeklab/${DRONE_REPO_NAME}', }, when: { diff --git a/.drone.yml b/.drone.yml index 363872d..d0be6e6 100644 --- a/.drone.yml +++ b/.drone.yml @@ -61,10 +61,9 @@ 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}" + - "[ -z \"$${DRONE_TAG}\" ] && BUILD_VERSION=$${DRONE_COMMIT_SHA:0:8} || BUILD_VERSION=$${DRONE_TAG##v}" - mkdir -p release/ - - cd cmd/drone-github-comment && xgo -ldflags "-s -w -X main.Version=$BUILD_VERSION" -tags netgo -targets 'linux/amd64,linux/arm-6,linux/arm64' -out drone-github-comment . - - ls -la /build/ + - cd cmd/drone-github-comment && xgo -ldflags "-s -w -X main.Version=$$BUILD_VERSION" -tags netgo -targets 'linux/amd64,linux/arm-6,linux/arm64' -out drone-github-comment . - mv /build/* /drone/src/release/ - name: executable @@ -84,6 +83,20 @@ steps: 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 @@ -366,7 +379,7 @@ steps: DOCKER_USER: from_secret: docker_username PUSHRM_FILE: README.md - PUSHRM_SHORT: Drone CI - Plugin to add comments to GitHub Issues/PRs + PUSHRM_SHORT: GitHub Comment - Drone plugin to add comments to GitHub Issues/PRs PUSHRM_TARGET: thegeeklab/${DRONE_REPO_NAME} when: status: @@ -416,6 +429,6 @@ depends_on: --- kind: signature -hmac: 14cc8682d5c27ee5548f9596f5778b82f331b5c2d5e2a816b874ae7682524335 +hmac: 0d83e319e617c570b761092c701b6b7a12607fcde2fcff0e007f536c8e11c6c0 ... diff --git a/.github/settings.yml b/.github/settings.yml new file mode 100644 index 0000000..93d4b41 --- /dev/null +++ b/.github/settings.yml @@ -0,0 +1,55 @@ +repository: + name: drone-github-comment + description: GitHub Comment - Dron plugin to add comments to GitHub Issues/PRs + topics: drone, drone-plugin + + private: false + has_issues: true + has_wiki: false + has_downloads: true + + default_branch: master + + allow_squash_merge: true + allow_merge_commit: true + allow_rebase_merge: true + +labels: + - name: bug + color: d73a4a + description: Something isn't working + - name: documentation + color: 0075ca + description: Improvements or additions to documentation + - name: duplicate + color: cfd3d7 + description: This issue or pull request already exists + - name: enhancement + color: a2eeef + description: New feature or request + - name: good first issue + color: 7057ff + description: Good for newcomers + - name: help wanted + color: 008672 + description: Extra attention is needed + - name: invalid + color: e4e669 + description: This doesn't seem right + - name: question + color: d876e3 + description: Further information is requested + - name: wontfix + color: ffffff + description: This will not be worked on + +branches: + - name: master + protection: + required_pull_request_reviews: null + required_status_checks: + strict: true + contexts: + - continuous-integration/drone/pr + enforce_admins: null + restrictions: null diff --git a/README.md b/README.md index 8f51fd5..41d75af 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # drone-github-comment -Drone CI - Plugin to add comments to GitHub Issues/PRs +GitHub Comment - Drone plugin to add comments to GitHub Issues/PRs [![Build Status](https://img.shields.io/drone/build/thegeeklab/drone-github-comment?logo=drone)](https://cloud.drone.io/thegeeklab/drone-github-comment) [![Docker Hub](https://img.shields.io/badge/dockerhub-latest-blue.svg?logo=docker&logoColor=white)](https://hub.docker.com/r/thegeeklab/drone-github-comment) [![Quay.io](https://img.shields.io/badge/quay-latest-blue.svg?logo=docker&logoColor=white)](https://quay.io/repository/thegeeklab/drone-github-comment) [![Source: GitHub](https://img.shields.io/badge/source-github-blue.svg?logo=github&logoColor=white)](https://github.com/thegeeklab/drone-github-comment) -[![License: MIT](https://img.shields.io/github/license/thegeeklab/drone-github-comment)]([LICENSE](https://github.com/thegeeklab/drone-github-comment/blob/master/LICENSE)) +[![License: MIT](https://img.shields.io/github/license/thegeeklab/drone-github-comment)](<[LICENSE](https://github.com/thegeeklab/drone-github-comment/blob/master/LICENSE)>) Drone plugin to add comments to GitHub Issues/PR's.