Skip to content
Snippets Groups Projects
goreleaser.sh 785 B
Newer Older
Gabriel Zachmann's avatar
Gabriel Zachmann committed
mkdir ../shared
first=$(grep '^## ' -nm1 CHANGELOG.md | cut -d':' -f1); \
  second=$(grep '^## ' -nm2 CHANGELOG.md | tail -n1 | cut -d':' -f1); \
  tail -n+$first CHANGELOG.md | head -n$(($second-$first)) > ../shared/release.md
Gabriel Zachmann's avatar
Gabriel Zachmann committed
GORELEASER_CONFIG=".goreleaser.yml"
if [ -n "$CI_COMMIT_TAG" ] && echo "$CI_COMMIT_TAG" | grep -qv '~'; then
Gabriel Zachmann's avatar
Gabriel Zachmann committed
GORELEASER_CONFIG=".goreleaser-release.yml"
fi
Gabriel Zachmann's avatar
Gabriel Zachmann committed
BASEDIR=/go/src/github.com/oidc-mytoken/server
docker run --rm --privileged \
Gabriel Zachmann's avatar
Gabriel Zachmann committed
  -v "$PWD":"$BASEDIR" \
  -w "$BASEDIR" \
Gabriel Zachmann's avatar
Gabriel Zachmann committed
  -v "${PWD}/../shared":/tmp/shared \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -e DOCKER_USERNAME -e DOCKER_PASSWORD \
  -e GITHUB_TOKEN \
  -e GORELEASER_CONFIG \
  goreleaser/goreleaser release -f $GORELEASER_CONFIG --release-notes /tmp/shared/release.md
Gabriel Zachmann's avatar
Gabriel Zachmann committed
ls -l results