release tool
This commit is contained in:
22
.drone.yml
Normal file
22
.drone.yml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
kind: pipeline
|
||||||
|
name: default
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: build
|
||||||
|
image: golang:latest
|
||||||
|
commands:
|
||||||
|
- make test
|
||||||
|
|
||||||
|
- name: coverage
|
||||||
|
image: plugins/codecov
|
||||||
|
settings:
|
||||||
|
token:
|
||||||
|
from_secret: codecov-token
|
||||||
|
|
||||||
|
- name: notify
|
||||||
|
image: plugins/webhook
|
||||||
|
urls:
|
||||||
|
when:
|
||||||
|
status:
|
||||||
|
- success
|
||||||
|
- failure
|
||||||
25
tools/release.sh
Normal file
25
tools/release.sh
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Get the highest tag number
|
||||||
|
VERSION="$(git describe --abbrev=0 --tags)"
|
||||||
|
VERSION=${VERSION:-'0.0.0'}
|
||||||
|
|
||||||
|
# Get number parts
|
||||||
|
MAJOR="${VERSION%%.*}"; VERSION="${VERSION#*.}"
|
||||||
|
MINOR="${VERSION%%.*}"; VERSION="${VERSION#*.}"
|
||||||
|
PATCH="${VERSION%%.*}"; VERSION="${VERSION#*.}"
|
||||||
|
|
||||||
|
# Increase version
|
||||||
|
PATCH=$((PATCH+1))
|
||||||
|
|
||||||
|
TAG="${1}"
|
||||||
|
|
||||||
|
if [ "${TAG}" = "" ]; then
|
||||||
|
TAG="${MAJOR}.${MINOR}.${PATCH}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Releasing ${TAG} ..."
|
||||||
|
|
||||||
|
git tag -a -s -m "Release ${TAG}" "${TAG}"
|
||||||
|
git push --tags
|
||||||
|
goreleaser
|
||||||
Reference in New Issue
Block a user