forked from operator-framework/operator-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
*: automate releases with goreleaser (operator-framework#4034)
This commit adds tooling for automated releases in CI using goreleaser, agnostic of CI platform (albeit with some environment configuration). Any Github user with write capabilities to the SDK repo can start a release. .ci/gpg: GPG public key, encrypted private subkey (used for signing), and script to decrypt private subkey in CI website/scripts: scripts to update versions in release commits and branches at build time .goreleaser.yml: goreleaser config file *: script and Makefile updates to support automated releases docs: release and installation guide simplifications, related docs cleanup
- Loading branch information
Eric Stroczynski
authored
Nov 30, 2020
1 parent
74f5a36
commit 7e490b4
Showing
22 changed files
with
579 additions
and
534 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" | ||
|
||
# Modified from https://blogs.itemis.com/en/secure-your-travis-ci-releases-part-2-signature-with-openpgp | ||
|
||
function err_exit() { | ||
echo "ERROR: ${1:-"Unknown Error"} Exiting." 1>&2 | ||
exit 1 | ||
} | ||
|
||
declare -r GPG_HOME="${DIR}/keyring" | ||
declare -r SECRING_AUTO="${GPG_HOME}/secring.auto" | ||
declare -r PUBRING_AUTO="${GPG_HOME}/pubring.auto" | ||
|
||
mkdir -p "$GPG_HOME" | ||
cp "${DIR}"/*.auto* "${GPG_HOME}" | ||
|
||
echo -e "\nDecrypting secret key..." | ||
{ | ||
# $GPG_PASSWORD is taken from the script's env (injected by Travis CI). | ||
echo $GPG_PASSWORD | gpg --decrypt \ | ||
--pinentry-mode loopback --batch \ | ||
--passphrase-fd 0 \ | ||
--output "${SECRING_AUTO}" \ | ||
"${SECRING_AUTO}".gpg ; \ | ||
} || { err_exit "Failed to decrypt secret key." ; } | ||
echo "Success!" | ||
|
||
echo -e "\nImporting keys..." | ||
{ gpg --home "${GPG_HOME}" --import "${PUBRING_AUTO}" ; } || { err_exit "Could not import public key into gpg." ; } | ||
{ gpg --home "${GPG_HOME}" --import "${SECRING_AUTO}" ; } || { err_exit "Could not import secret key into gpg." ; } | ||
echo "Success!" |
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,64 @@ | ||
-----BEGIN PGP PUBLIC KEY BLOCK----- | ||
|
||
mQINBF+clTQBEADMHVz8qS+dcYC0qxlSNe4Yipbr/BtVuWGJay26OAbS4K7sjzs3 | ||
XP+RhjUsJGOnPXn+N/zM6wVNczV7MrdfWNK1UAWBPVC4HjD/ysj/m5lMv/j0RNym | ||
W6VNdSgV4YWyQHn6eD279gT4p6GAVvQj0eXnWtX7eA0SaITi6dMNqw8QcTOBxzFI | ||
PXw+4MDJJKDAammtNKgj6LtmYc3o9d8aqbwtPfj3Vvi5d3SWfMx8a+2aSDkVcsva | ||
bloGUBXYWFzO11T4OYvUYXgQdaKHyT+ZWGCpDsnQV/KqG5S456jmV+Qp+98vwe8k | ||
XhXhlkjauhbvVR0uGAv0RJ4NZPSmWpie6f7ApQ3XTg3+ZvsrTvi3STCkOKA8/CLm | ||
/xRhAF/aFZSOLlgzyAxr45j0PRjzX3XJfPePkV1D1cFso3JGDT5Y2oku8bNqYTof | ||
fV/vw6jxylSNKApn1VyViwZ0+aE9kjMHXytKWWLK+woxrFOG74nGcI+xBOAOHvSU | ||
GRh5EVXydbyMxqEpq2Su+rHlzfzgPh+hORNQgrag+qdbTVMimCoD+datX4854Hkb | ||
nah+mq7RtI0k5Nn+ENm4ufbHEKiNb56qFTNgMkquG5vxpA6NOlZ0QfKUxiDU08+g | ||
Pix7+TY7lzNhGipD7QjqfuJJr+1k3p/GrIpoHl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M5p04mMuBr6nswy1W94q6uuINwq6q1ycf | ||
YQJyoKhXifPhdicwDMYeuW7aP7WnPIb3VwdtlEyD+ycBsak0Jsq/+yrov3pXgrdL | ||
dlF2O4uTr4frwKRl28eGEQ== | ||
=ebPb | ||
-----END PGP PUBLIC KEY BLOCK----- |
Binary file not shown.
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,90 @@ | ||
# Global environment variables for builds. | ||
env: | ||
- CGO_ENABLED=0 | ||
- GO111MODULE=on | ||
- GOPROXY=https://proxy.golang.org|direct | ||
- REPO=github.com/operator-framework/operator-sdk | ||
|
||
# Hooks to run before any build is run. | ||
before: | ||
hooks: | ||
- go version | grep --quiet "go1\.15\.5" || echo "Go binary version must be 1.15.5" | ||
- go mod download | ||
|
||
# Binary builds. | ||
builds: | ||
# operator-sdk build steps | ||
- id: operator-sdk | ||
main: ./cmd/operator-sdk | ||
binary: operator-sdk | ||
mod_timestamp: "{{ .CommitTimestamp }}" | ||
asmflags: &build-asmflags | ||
- all=-trimpath={{ .Env.PWD }} | ||
gcflags: &build-gcflags | ||
- all=-trimpath={{ .Env.PWD }} | ||
ldflags: &build-ldflags | ||
- -X {{ .Env.REPO }}/internal/version.Version={{ .Env.SIMPLE_VERSION }} | ||
- -X {{ .Env.REPO }}/internal/version.GitVersion={{ .Env.GIT_VERSION }} | ||
- -X {{ .Env.REPO }}/internal/version.GitCommit={{ .Env.GIT_COMMIT }} | ||
- -X {{ .Env.REPO }}/internal/version.KubernetesVersion={{ .Env.K8S_VERSION }} | ||
- -X {{ .Env.REPO }}/internal/version.ImageVersion={{ .Env.IMAGE_VERSION }} | ||
targets: &build-targets | ||
- darwin_amd64 | ||
- linux_amd64 | ||
- linux_arm64 | ||
- linux_ppc64le | ||
- linux_s390x | ||
|
||
# ansible-operator build steps | ||
- id: ansible-operator | ||
main: ./cmd/ansible-operator | ||
binary: ansible-operator | ||
mod_timestamp: "{{ .CommitTimestamp }}" | ||
asmflags: *build-asmflags | ||
gcflags: *build-gcflags | ||
ldflags: *build-ldflags | ||
targets: *build-targets | ||
|
||
# helm-operator build steps | ||
- id: helm-operator | ||
main: ./cmd/helm-operator | ||
binary: helm-operator | ||
mod_timestamp: "{{ .CommitTimestamp }}" | ||
asmflags: *build-asmflags | ||
gcflags: *build-gcflags | ||
ldflags: *build-ldflags | ||
targets: *build-targets | ||
|
||
# Use most recent tag and short commit for snapshot version. | ||
snapshot: | ||
name_template: "{{ .Env.GIT_VERSION }}" | ||
|
||
# We don't use archives, so skip creating them. | ||
archives: | ||
- format: binary | ||
name_template: "{{ .Binary }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}" | ||
|
||
checksum: | ||
name_template: "checksums.txt" | ||
|
||
# Sign the checksum file with the CI GPG key. | ||
signs: | ||
- signature: "${artifact}.asc" | ||
artifacts: checksum | ||
# Use the CI signing subkey A20B5C7E decrypted into .ci/gpg/keyring to sign the release. | ||
args: ["--home", ".ci/gpg/keyring", "-u", "A20B5C7E", "--output", "${signature}", "--detach-sign", "${artifact}"] | ||
|
||
# We use a custom changelog generator. | ||
changelog: | ||
|
||
# TODO(estroz): configure homebrew publishing | ||
# brews: | ||
# - name: operator-sdk | ||
# ids: | ||
# - operator-sdk | ||
|
||
# Uncomment for testing | ||
# release: | ||
# github: | ||
# owner: <your-github-namespace> | ||
# name: operator-sdk |
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
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
Oops, something went wrong.