1
0
mirror of https://github.com/taigrr/yq synced 2025-01-18 04:53:17 -08:00

Task: Add release process

This commit is contained in:
kenjones
2017-09-24 21:10:57 -04:00
parent 9d1a5b17b8
commit a00e6c5316
4 changed files with 48 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ go get -u github.com/alecthomas/gometalinter
go get -u golang.org/x/tools/cmd/goimports
go get -u github.com/mitchellh/gox
go get -u github.com/kardianos/govendor
go get -u github.com/aktau/github-release
# install all the linters
gometalinter --install --update

40
scripts/publish.sh Executable file
View File

@@ -0,0 +1,40 @@
#!/bin/bash
GITHUB_TOKEN="${GITHUB_TOKEN:?missing required input \'GITHUB_TOKEN\'}"
CURRENT="$(git describe --tags --abbrev=0)"
PREVIOUS="$(git describe --tags --abbrev=0 --always "${CURRENT}"^)"
OWNER="mikefarah"
REPO="yaml"
release() {
mapfile -t logs < <(git log --pretty=oneline --abbrev-commit "${PREVIOUS}".."${CURRENT}")
description="$(printf '%s\n' "${logs[@]}")"
github-release release \
--user "$OWNER" \
--repo "$REPO" \
--tag "$CURRENT" \
--description "$description" ||
github-release edit \
--user "$OWNER" \
--repo "$REPO" \
--tag "$CURRENT" \
--description "$description"
}
upload() {
mapfile -t files < <(find ./build -mindepth 1 -maxdepth 1)
for file in "${files[@]}"; do
BINARY=$(basename "${file}")
echo "--> ${BINARY}"
github-release upload \
--user "$OWNER" \
--repo "$REPO" \
--tag "$CURRENT" \
--name "${BINARY}" \
--file "$file"
done
}
release
upload