feat: rewrite the release pipeline to make it clean #2038
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I hereby agree to the terms of the GreptimeDB CLA
What's changed and what's your intention?
It's almost the rewrite of
release.yml
.Why need to rewrite
release.yml
The original
release.yml
has the following disadvantages:release.yml
uses cross-compiling to build the artifacts instead of Dockerfile;The new
release.yml
actions/
The new
release.yml
use composite action to decouple the logic in.github/actions/
Start/Stop EC2 runners
.github/actions/start-runner
.github/actions/stop-runner
Binary building
.github/actions/build-greptime-binary
: Usemake build-greptime-by-buildx
command to buildgreptime
and upload it;.github/actions/build-linux-artifacts
: Use.github/actions/build-greptime-binary
to build Linuxgreptime
by different base images and features..github/actions/build-macos-artifacts
: Still use cross-compiling to build macOS artifacts(most of logic is ported from the original implementation);Image building
.github/actions/build-images/
: Use.github/actions/build-greptime-image
to build and push docker images that are based on the different base images;.github/actions/build-greptime-image
: Build multiple platform docker image by buildx;.github/actions/build-dev-builder-image
: Build and push dev-builder image;Releasing and distribution
.github/actions/release-artifacts
: Create GitHub release notes and release artifacts;.github/actions/upload-artifacts
: Uploadgreptime
binary and checksum to GitHub Artifacts and S3;release.yml
The new
release.yml
split multiple small and clear jobs to handle releasing:At first, we need to use the
allocate-runners
job to create a version(.github/scripts/create-version.sh
) tag and allocate runners;After all the resources are ready, the pipeline begins to build multiple binary artifacts;
After all the binary artifacts are ready, the pipeline begins to build and push docker images;
At last, the release pipeline will create the GitHub Relase;
The new manual inputs panel
The new manual inputs panel maybe looks complicated but integrates multiple building choices:
The Actions variables and secrets
All the variables and secrets are maintained by Greptime.
Variables
DEFAULT_SKIP_TEST
DEFAULT_AMD64_RUNNER
ubuntu-latest
,ec2-c6i.4xlarge-amd64
etc.DEFAULT_ARM64_RUNNER
ec2-c6g.xlarge-arm64
,ec2-c6g.2xlarge-arm64
etc. For now, GitHub Actions don't support the aarch64 runner.DEFAULT_MACOS_RUNNER
EC2_RUNNER_LINUX_AMD64_IMAGE_ID
EC2_RUNNER_LINUX_ARM64_IMAGE_ID
EC2_RUNNER_REGION
EC2_RUNNER_SUBNET_ID
EC2_RUNNER_SECURITY_GROUP_ID
AWS_RELEASE_BUCKET
AWS_RELEASE_BUCKET_REGION
IMAGE_NAMESPACE
greptimedb
.ACR_IMAGE_REGISTRY
greptime-registry.cn-hangzhou.cr.aliyuncs.com
.Secrets
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_CN_ACCESS_KEY_ID
AWS_CN_SECRET_ACCESS_KEY
DOCKERHUB_USERNAME
DOCKERHUB_TOKEN
ALICLOUD_USERNAME
ALICLOUD_PASSWORD
Checklist
Refer to a related PR or issue link (optional)