-
Notifications
You must be signed in to change notification settings - Fork 912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First step towards release automation #2340
Conversation
711d584
to
62a5048
Compare
cf6ccc5
to
ebc00b3
Compare
ad1cf44
to
e951983
Compare
a50dcdb
to
5dfc2a7
Compare
Reverted All updates reflected in the PR description above. |
@dougm ready for another review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks @embano1 !!
First PR towards fully automating the release process with `goreleaser`. Cutting a release is still done manually, but using the goreleaser configuration provided in this PR. Once we gain confidence in the associated Github Actions workflows we can finally switch towards full release automation. This PR also adds more tests and build verification.⚠️ **BREAKING** Release artefacts created by the provided `goreleaser` configuration use a different naming template. In addition, the `386` `GOARCH` is dropped. This is to allow scripts to easily download and reference the correct binary per platform/arch (e.g. using `uname`). Example for `vcsim`: ```bash vcsim_FreeBSD_armv6.tar.gz vcsim_Windows_x86_64.zip vcsim_Darwin_arm64.tar.gz vcsim_Darwin_x86_64.tar.gz vcsim_Linux_mips64le.tar.gz vcsim_FreeBSD_x86_64.tar.gz vcsim_Linux_x86_64.tar.gz vcsim_Linux_armv6.tar.gz vcsim_Linux_arm64.tar.gz vcsim_FreeBSD_arm64.tar.gz ``` Homebrew files will be created during a manual release but not yet pushed to the pre-configured `govmomi/homebrew-tap`. This will be fixed in a subsequent PR when switching to full release automation. The Homebrew community provides `govc` in the core repo (not validated by govmomi maintainers though). Docker images (separate for `govc` and `vcsim`) for `linux/amd64` will be created and pushed during a manual run. Example tags pushed for `govc`: ```bash vmware/govc:6a3ba216 vmware/govc:latest vmware/govc:v0.25.0 ```⚠️ **BREAKING** The checksum file is renamed to `checksums.txt`. The go modules version is bumped to use `v1.14` [semantics](https://golang.org/doc/modules/gomod-ref#go). The go tool will use vendoring by default. For explicitness and documentation purposes `-mod=vendor` is still passed in various build/test related workflows. Tests will be run against Go `v1.15` and `v1.16`. Builds (releases) will are configured to use Go `v1.16` (once we use automated releases). `govc version` output is enhanced to include build related information (injected via `goreleaser`). Example: ```bash govc version -l Build Version: v0.25.0 Build Commit: 6a3ba21 Build Date: 2021-04-04T19:00:11Z ``` The old behavior is retained: ```bash govc version govc 0.25.0 ``` `vcsim` shows version with a new subcommand: ```bash ./vcsim version Build Version: 0.25.0 Build Commit: 6a3ba21 Build Date: 2021-04-01T12:01:20Z ``` Add `make govc-test` Makefile target in a new `govc-tests` workflow. Remove `GORACE: history_size=5` from unit tests as it seems to be the cause for flaky unit tests in CI. Verify build/releasability by running a new workflow on every PR/push to master and as a daily cron job which mimics a `goreleaser` run (without pushing a release, artefacts, etc.). Fix wording in the stale issue/PR workflow. Add 10min timeout to most workflows to prevent dangling workflow runs. Use a custom `powercli` image in `bats` tests to avoid Docker rate limit pulls: `projects.registry.vmware.com/pez/powerclicore`. Instead of using a `curl` container, use `curl` provided as part of the runner to avoid rate limits/reduce time. The `vcsim` Dockerfile uses `CMD` instead of `ENTRYPOINT` so it's possible to overwrite the executable, e.g. to extract version information with: ```bash docker run --rm vmware/vcsim /vcsim version Build Version: 0.25.0 Build Commit: 6a3ba21 Build Date: 2021-04-01T12:01:20Z ```⚠️ The `govc-test` target seems to be flaky in CI (randomly hangs until timeout enforced) as reported by other users (vmware#2351) and from my experience running the PR checks. That's why this is a separate workflow so it's easy to re-run a failed workflow. Closes: vmware#2339 Related: vmware#2302, vmware#1844, vmware#2295 Signed-off-by: Michael Gasch <mgasch@vmware.com>
@dougm addressed your feedback, all checks pass. Approval got dismissed due to force-push. Please approve and merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @embano1 ! 🎉
Pinged homebrew-core team about the upcoming change: Homebrew/discussions#1262 |
First PR towards fully automating the release process with
goreleaser
. Cutting a release is still done manually, but using the goreleaser configuration provided in this PR. Once we gain confidence in the associated Github Actions workflows we can finally switch towards full release automation. This PR also adds more tests and build verification.Changes
(1) Release Artefacts
goreleaser
configuration use a different naming template. In addition, the386
GOARCH
is dropped. This is to allow scripts to easily download and reference the correct binary per platform/arch (e.g. usinguname
). Example forvcsim
:Homebrew files will be created during a manual release but not yet pushed to the pre-configured
govmomi/homebrew-tap
. This will be fixed in a subsequent PR when switching to full release automation. The Homebrew community providesgovc
in the core repo (not validated by govmomi maintainers though).Docker images (separate for
govc
andvcsim
) forlinux/amd64
will be created and pushed during a manual run. Example tags pushed forgovc
:checksums.txt
.(2) Build
The go modules version is bumped to use
v1.14
semantics. The go tool will use vendoring by default. For explicitness and documentation purposes-mod=vendor
is still passed in various build/test related workflows. Tests will be run against Gov1.15
andv1.16
. Builds (releases) will are configured to use Gov1.16
(once we use automated releases).govc version
output is enhanced to include build related information (injected viagoreleaser
). Example:# with pseudo commit example using the "long" flag option govc version -l Build Version: v0.25.0 Build Commit: 6a3ba216 Build Date: 2021-04-04T19:00:11Z
The old behavior is retained:
vcsim
shows version with a new subcommand:# with pseudo commit example ./vcsim version Build Version: 0.25.0 Build Commit: 6a3ba216 Build Date: 2021-04-01T12:01:20Z
(3) New/Updated Workflows
Add
make govc-test
Makefile target in a newgovc-tests
workflow.Remove
GORACE: history_size=5
from unit tests as it seems to be the cause for flaky unit tests in CI.Verify build/releasability by running a new workflow on every PR/push to master and as a daily cron job which mimics a
goreleaser
run (without pushing a release, artefacts, etc.).Fix wording in the stale issue/PR workflow.
Add 10min timeout to most workflows to prevent dangling workflow runs.
(4) Other
Use a custom
powercli
image inbats
tests to avoid Docker rate limit pulls:projects.registry.vmware.com/pez/powerclicore
.Instead of using a
curl
container, usecurl
provided as part of the runner to avoid rate limits/reduce time.The
vcsim
Dockerfile usesCMD
instead ofENTRYPOINT
so it's possible to overwrite the executable, e.g. to extract version information with:govc-test
target seems to be flaky in CI (randomly hangs until timeout enforced) as reported by other users (#2351) and from my experience running the PR checks. That's why this is a separate workflow so it's easy to re-run a failed workflow.Closes: #2339
Related: #2302, #1844, #2295
Signed-off-by: Michael Gasch mgasch@vmware.com