chore(release): update release process

This commit is contained in:
DataHearth 2022-08-20 18:32:54 +02:00
parent 8efdca8fe4
commit fe4ff05d5d
No known key found for this signature in database
GPG Key ID: E88FD356ACC5F3C4
1 changed files with 15 additions and 1 deletions

View File

@ -1,5 +1,7 @@
#!/bin/bash
set -e
VERSION=v0.5.0
log() {
@ -48,6 +50,14 @@ if ! type git-chglog 1> /dev/null; then
log "ERROR" "\"git-chglog\" binary not available"
exit 1
fi
if ! type jq 1> /dev/null; then
log "ERROR" "\"jq\" binary not available"
exit 1
fi
if ! type xhs 1> /dev/null; then
log "ERROR" "\"xhs\" binary not available"
exit 1
fi
read -p "Enter a release version (vX.Y.Z): " release
@ -72,4 +82,8 @@ log "INFO" "building Darwin binary"
GOOS=darwin go build -o build/x86-x64_darwin_config-mapper
log "INFO" "creating release"
git-chglog -t .chglog/RELEASE_CHANGELOG.tpl.md | gh release create -F - $release build/x86-x64_*
local response=$(xhs POST https://gitea.antoine-langlois.net/api/v1/repos/DataHearth/config-mapper/releases Authorization:"token $GIT_CFG_MAPPER_TOKEN" body=$(git-chglog -t .chglog/RELEASE_CHANGELOG.tpl.md) draft:=false name=$release prerelease:=false tag_name=$release)
local release_id=$(echo $reponse | jq .id)
xhs POST https://gitea.antoine-langlois.net/api/v1/repos/DataHearth/config-mapper/releases/$release_id/assets name=="x86-x64_linux_config-mapper" Authorization:"token $GIT_CFG_MAPPER_TOKEN" attachement@build/x86-x64_linux_config-mapper
xhs POST https://gitea.antoine-langlois.net/api/v1/repos/DataHearth/config-mapper/releases/$release_id/assets name=="x86-x64_darwin_config-mapper" Authorization:"token $GIT_CFG_MAPPER_TOKEN" attachement@build/x86-x64_darwin_config-mapper