-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
introduce release.sh script and add support for GPG signing of releases
- Loading branch information
Showing
5 changed files
with
59 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ Attic/ | |
cover.out | ||
.vagrant | ||
vault-token-helper.exe | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
# this script is intended to be run inside the dockercore/golang-cross docker image, eg: | ||
# | ||
# docker run \ | ||
# --rm \ | ||
# -e "GITHUB_TOKEN=$GITHUB_TOKEN" \ | ||
# -e "GPG_KEY=$GPG_KEY" \ | ||
# -v `pwd`:/src \ | ||
# -w /src \ | ||
# dockercore/golang-cross \ | ||
# /src/release.sh | ||
# | ||
# (optional) arguments will be passed to goreleaser, eg: | ||
# | ||
# /src/release.sh --snapshot --rm-dist | ||
# | ||
# (optional) sign releases with $GPG_KEY. The key should be base64 encoded. | ||
|
||
set -eou pipefail | ||
|
||
GORELEASER_ARGS=("$@") | ||
|
||
if [[ -n "${GPG_KEY:-}" ]]; then | ||
GNUPGHOME="$HOME/releaser-gpg" | ||
export GNUPGHOME | ||
mkdir -p "$GNUPGHOME" | ||
chmod 0700 "$GNUPGHOME" | ||
|
||
echo "$GPG_KEY" \ | ||
| base64 --decode --ignore-garbage \ | ||
| gpg --batch --allow-secret-key-import --import | ||
|
||
gpg --keyid-format LONG --list-secret-keys | ||
|
||
trap 'rm -rf -- "$GNUPGHOME"' EXIT | ||
else | ||
echo "==> WARNING: Missing GPG_KEY env var, skipping GPG signing of the release" | ||
GORELEASER_ARGS+=("--skip-sign") | ||
fi | ||
|
||
apt-get -qy update | ||
apt-get -qy install rpm | ||
|
||
curl -sL https://git.io/goreleaser | bash -s -- "${GORELEASER_ARGS[@]}" |