forked from kubernetes-sigs/cluster-api-provider-aws
-
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.
✨ use goreleaser for releasing binary (kubernetes-sigs#4748)
* use goreleaser for releasing the binaries Signed-off-by: Anurag <81210977+kranurag7@users.noreply.github.com> * disable releasing of binaries using make targets since we intend to use goreleaser now, we can remove the make targets. This commit does the same. Signed-off-by: Anurag <81210977+kranurag7@users.noreply.github.com> * Update release-binaries target to use goreleaser * Add goreleaser as a tool dependency * Update .goreleaser configuration to upload YAML templates as GitHub release artifacts * Create binaries rather than archives to mimic current uploads. Signed-off-by: Nolan Brubaker <nolan@nbrubaker.com> * Update documentation and remove unused targets Signed-off-by: Nolan Brubaker <nolan@nbrubaker.com> * Remove unused gh targets/client Signed-off-by: Nolan Brubaker <nolan@nbrubaker.com> * Updates based on doing dry runs * Remove Windows format override * Move goreleaser invocation into the Makefile * Add output directory to goreleaser configuration * Use generated release notes as the release contents * Run make release target inside the GitHub workflow * Set expected environment variables in the GitHub workflow * Build goreleaser before running the release target Signed-off-by: Nolan Brubaker <nolan@nbrubaker.com> * Updates based on doing dry runs * Remove Windows format override * Move goreleaser invocation into the Makefile * Add output directory to goreleaser configuration * Use generated release notes as the release contents * Run make release target inside the GitHub workflow * Set expected environment variables in the GitHub workflow * Build goreleaser before running the release target * Force goreleaser to use local config * Set RELEASE_TAG env variable for release notes * Output env vars for debugging * Re-enable changelog support Signed-off-by: Nolan Brubaker <nolan@nbrubaker.com> * Remove reference to unused steps Signed-off-by: Nolan Brubaker <nolan@nbrubaker.com> --------- Signed-off-by: Anurag <81210977+kranurag7@users.noreply.github.com> Signed-off-by: Nolan Brubaker <nolan@nbrubaker.com> Co-authored-by: Nolan Brubaker <nolan@nbrubaker.com>
- Loading branch information
Showing
11 changed files
with
505 additions
and
126 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,38 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
permissions: | ||
contents: write # required to write to github release. | ||
|
||
jobs: | ||
release: | ||
name: Create draft release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.21' | ||
- name: Set version info | ||
run: | | ||
echo "VERSION=${GITHUB_REF_NAME}" >> $GITHUB_ENV | ||
echo "PREVIOUS_VERSION=$(git describe --abbrev=0 2> /dev/null)" >> $GITHUB_ENV | ||
echo "RELEASE_BRANCH=release-$(echo ${GITHUB_REF_NAME} | grep -Eo '[0-9]\.[0-9]+')" >> $GITHUB_ENV | ||
echo "RELEASE_TAG=${GITHUB_REF_NAME}" >> $GITHUB_ENV | ||
- name: Run release | ||
run: | | ||
echo "Version is: $VERSION" | ||
echo "Previous version is: $PREVIOUS_VERSION" | ||
echo "Release branch is: $RELEASE_BRANCH" | ||
echo "Release tag is: $RELEASE_TAG" | ||
make release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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 |
---|---|---|
|
@@ -57,6 +57,7 @@ junit.*.xml | |
.DS_Store | ||
|
||
.tiltbuild | ||
dist | ||
|
||
# test results | ||
_artifacts | ||
|
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 @@ | ||
builds: | ||
# clusterctl-aws | ||
- id: "clusterctl-aws" | ||
main: ./cmd/clusterawsadm | ||
binary: bin/clusterctl-aws | ||
env: | ||
- CGO_ENABLED=0 | ||
ldflags: | ||
- -s -w | ||
- -X 'sigs.k8s.io/cluster-api-provider-aws/v2/version.gitMajor={{.Major}}' | ||
- -X 'sigs.k8s.io/cluster-api-provider-aws/v2/version.gitMinor={{.Minor}}' | ||
- -X 'sigs.k8s.io/cluster-api-provider-aws/v2/version.gitVersion={{.Version}}' | ||
- -X 'sigs.k8s.io/cluster-api-provider-aws/v2/version.gitCommit={{.Commit}}' | ||
- -X 'sigs.k8s.io/cluster-api-provider-aws/v2/version.gitTreeState={{.GitTreeState}}' | ||
- -X 'sigs.k8s.io/cluster-api-provider-aws/v2/version.buildDate={{.Date}}' | ||
- -X 'sigs.k8s.io/cluster-api-provider-aws/v2/cmd/clusterawsadm/cmd/version.CLIName=clusterctl-aws' | ||
goos: | ||
- linux | ||
- darwin | ||
- windows | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
|
||
# clusterawsadm | ||
- id: "clusterawsadm" | ||
main: ./cmd/clusterawsadm | ||
binary: bin/clusterawsadm | ||
env: | ||
- CGO_ENABLED=0 | ||
ldflags: | ||
- -s -w | ||
- -X 'sigs.k8s.io/cluster-api-provider-aws/v2/version.gitMajor={{.Major}}' | ||
- -X 'sigs.k8s.io/cluster-api-provider-aws/v2/version.gitMinor={{.Minor}}' | ||
- -X 'sigs.k8s.io/cluster-api-provider-aws/v2/version.gitVersion={{.Version}}' | ||
- -X 'sigs.k8s.io/cluster-api-provider-aws/v2/version.gitCommit={{.Commit}}' | ||
- -X 'sigs.k8s.io/cluster-api-provider-aws/v2/version.gitTreeState={{.GitTreeState}}' | ||
- -X 'sigs.k8s.io/cluster-api-provider-aws/v2/version.buildDate={{.Date}}' | ||
goos: | ||
- linux | ||
- darwin | ||
- windows | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
|
||
archives: | ||
- id: clusterctl-aws | ||
builds: | ||
- clusterctl-aws | ||
name_template: "clusterctl-aws_{{ .Tag }}_{{ .Os }}_{{ .Arch }}" | ||
format: binary | ||
- id: clusterawsadm | ||
builds: | ||
- clusterawsadm | ||
name_template: "clusterawsadm_{{ .Tag }}_{{ .Os }}_{{ .Arch }}" | ||
format: binary | ||
|
||
release: | ||
discussion_category_name: General | ||
extra_files: | ||
- glob: ./templates/*.yaml | ||
- glob: ./out/* | ||
draft: true |
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.