-
Notifications
You must be signed in to change notification settings - Fork 182
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
chore(ci): GHA - artifact build and push to GAR & GCS #329
Conversation
Each time a fork's master branch is resync'd with spinnaker/<repo> we don't want to trigger GHA CI.
Maintain existing behaviours: shared: - build for darwin, linux, windows, all on amd64, we can add aarch64 if wish. on release: - publish to `spinnaker-artifacts/spin/<release>/<os>/<arch>/spin(.exe)` - publish `spinnaker-artifacts/spin/latest` text file with new version if version is newest (version sort). eg: 1.23.0 newer than 1.22.5. - publish `spinnaker-artifacts/spin/<MAJOR.MINOR>.x-latest` text file with version number, eg: 1.23.0 or 1.23.1. Assuming we always do increment patch versions. on merge master or release-* branch: - publish to `spinnaker-artifacts/spin/<branch>/<git sha>-<datetime>/<os>/<arch>/spin(.exe)` - this is different see next paragraph Changes from previous behaviour: Previous builds were always `spinnaker-artifacts/spin/<tag>-<datetime>/<os>/<arch>/spin(.exe)` except for final release versions (1.22.0). eg: ``` 1.17.3-20201209030017/ 1.17.3-20201210030017/ 1.17.3/ ``` However I believe it is easier to sort and review with the extra branch or release number directory, eg: ``` master/<git-sha>-<datetime>/... release-1.17.x/<git-sha>-<datetime>/... ``` This is also consistent with the container image tags now generated in GHA.
This task has been moved into GHA per preceding commit.
Docs PR: spinnaker/spinnaker.io#187 |
Tested creating releases on my fork with #328 and this PR merged. version
version
A few tags later confirming version supply via ldflag:
|
We don't need extra job for test when `go test` is fast and we are performing the same setup steps for `build` job. Also Dockerfile doesn't have `go test` step.
# use service account flow defined at: https://github.com/google-github-actions/upload-cloud-storage#authenticating-via-service-account-key-json | ||
with: | ||
credentials_json: '${{ secrets.GAR_JSON_KEY }}' | ||
- name: Upload spin CLI binaries to GCS |
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.
It is questionable about whether we want to publish binaries and container images on every merge master
and release-*
branch. It does create a lot of artifacts that one might need to sort through.
Currently in the GCS Bucket the folder naming convention is:
spin/<tag>/...
, andspin/<tag>-<date>/...
- << perhaps this was done on merge master and other cadences? Can't tell because Jenkins is dead.
It's possible to sort the bucket to get to final releases but by default 1.17
, etc will be at the end of the list of 800+ items shown.
The naming convention in this PR puts master
and release-*
commits into subfolder's.
This makes it easier to browse the bucket and filter for an artifact "in between" official releases. One can also search by git sha, etc.
It would be even easier to casually browse through if older spin/<tag>-<date>/
versions were deleted or moved to their own "older" folder.
Proposed convention:
spin/<tag>/...
for releases,spin/master/<git sha>-<date time>/...
spin/release-1.26.x/<git sha>-<date time>/...
spin/release-1.27.x/<git sha>-<date time>/...
9fb5ae0
to
3e9722d
Compare
- collapse version info gathering steps into single `build_variables` step - collapse version info parts into single string and use everywhere. - use short git sha: `(git rev-parse --short HEAD)`
@Mergifyio update |
✅ Branch has been successfully updated |
@Mergifyio backport release-1.27.x |
* chore(ci): GHA - container image build and push * fix(ci): for PR's build container without GAR login * fix(ci): dont't run GHA build on forks Each time a fork's master branch is resync'd with spinnaker/<repo> we don't want to trigger GHA CI. * chore(ci): GHA - Build and Publish spin binaries to GCS Maintain existing behaviours: shared: - build for darwin, linux, windows, all on amd64, we can add aarch64 if wish. on release: - publish to `spinnaker-artifacts/spin/<release>/<os>/<arch>/spin(.exe)` - publish `spinnaker-artifacts/spin/latest` text file with new version if version is newest (version sort). eg: 1.23.0 newer than 1.22.5. - publish `spinnaker-artifacts/spin/<MAJOR.MINOR>.x-latest` text file with version number, eg: 1.23.0 or 1.23.1. Assuming we always do increment patch versions. on merge master or release-* branch: - publish to `spinnaker-artifacts/spin/<branch>/<git sha>-<datetime>/<os>/<arch>/spin(.exe)` - this is different see next paragraph Changes from previous behaviour: Previous builds were always `spinnaker-artifacts/spin/<tag>-<datetime>/<os>/<arch>/spin(.exe)` except for final release versions (1.22.0). eg: ``` 1.17.3-20201209030017/ 1.17.3-20201210030017/ 1.17.3/ ``` However I believe it is easier to sort and review with the extra branch or release number directory, eg: ``` master/<git-sha>-<datetime>/... release-1.17.x/<git-sha>-<datetime>/... ``` This is also consistent with the container image tags now generated in GHA. * chore(ci): Remove binary upload to GCS bucket script This task has been moved into GHA per preceding commit. * chore(ci): GHA - Test and build binaries before containers We don't need extra job for test when `go test` is fast and we are performing the same setup steps for `build` job. Also Dockerfile doesn't have `go test` step. * chore(ci): GHA - simplify build versioning - collapse version info gathering steps into single `build_variables` step - collapse version info parts into single string and use everywhere. - use short git sha: `(git rev-parse --short HEAD)` Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> (cherry picked from commit 95b72f7) # Conflicts: # .github/workflows/build.yml
✅ Backports have been created
|
Depends on #328 including removing
RELEASE_PHASE
as it is not supplied todocker build
in the GHA yml files.There has been requests for an official
spin
container image in Slack and GitHub issues - eg: spinnaker/spinnaker#4531. Per other services we can push latest, release branch and official release versions to GAR like other services.Container registry location (repo to be created on first push): https://console.cloud.google.com/artifacts/docker/spinnaker-community/us/docker
Binaries were previously published to GCS by Jenkins and a replacement for this in GHA has been added.
GCS bucket: https://console.cloud.google.com/storage/browser/spinnaker-artifacts/spin?cloudshell=false&project=spinnaker-community
Helps with: spinnaker/spinnaker#6477