-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7632 from yuxiang-zhang/enable-brew-pr
Refactor release workflows
- Loading branch information
Showing
21 changed files
with
141 additions
and
675 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
File renamed without changes.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,18 +1,80 @@ | ||
name: publish-release | ||
name: Publish Release per Type (nested jobs) | ||
on: | ||
push: | ||
tags: | ||
- '[0-9]+.[0-9]+.[0-9]+' | ||
workflow_call: | ||
inputs: | ||
isReleaseCandidate: | ||
required: true | ||
type: boolean | ||
name: | ||
required: true | ||
type: string | ||
secrets: | ||
customToken: | ||
required: true | ||
|
||
jobs: | ||
test-and-build: | ||
uses: ./.github/workflows/test-and-build.yaml | ||
publish-release: | ||
name: Publish GitHub release | ||
uses: ./.github/workflows/publish-release-type.yaml | ||
needs: [test-and-build] | ||
with: | ||
isReleaseCandidate: false | ||
name: release | ||
secrets: | ||
githubToken: ${{ secrets.EKSCTLBOT_TOKEN }} | ||
name: ${{ inputs.isReleaseCandidate && 'prerelease' || 'release' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Free up disk space | ||
run: | | ||
echo "Available storage:" | ||
df -h && echo | ||
sudo docker image prune --all --force | ||
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL | ||
echo "Available storage:" | ||
df -h | ||
- name: Checkout | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 | ||
|
||
- name: Set variables | ||
id: vars | ||
run: | | ||
if [ -z "${GITHUB_REF_NAME}" ] || [ "${GITHUB_REF_TYPE}" != "tag" ] ; then | ||
echo "Expected a tag push event, skipping release workflow" | ||
exit 1 | ||
fi | ||
tag=${GITHUB_REF_NAME} | ||
echo "GORELEASER_CURRENT_TAG=v${tag}" >> $GITHUB_ENV | ||
echo "RELEASE_DESCRIPTION=${tag}" >> $GITHUB_ENV | ||
RELEASE_NOTES_FILE="docs/release_notes/${tag/-rc.*}.md" | ||
echo "RELEASE_NOTES_FILE=${RELEASE_NOTES_FILE}" >> $GITHUB_ENV | ||
if [ ! -f "${RELEASE_NOTES_FILE}" ]; then | ||
echo "Release notes ${RELEASE_NOTES_FILE} not found. Exiting..." | ||
exit 1 | ||
fi | ||
# Update eksctl version to release-candidate | ||
echo "PRE_RELEASE_ID=${tag#*-}" >> $GITHUB_OUTPUT | ||
cat .github/.goreleaser.yml .github/.goreleaser.brew.yml > .github/.goreleaser.brew.combined.yml | ||
- name: Setup build environment | ||
uses: ./.github/actions/setup-build | ||
|
||
- name: GoReleaser Release | ||
if: ${{ !inputs.isReleaseCandidate }} | ||
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 #v5.0.0 | ||
with: | ||
version: v1.24.0 | ||
args: release --clean --timeout 60m --skip=validate --config=.github/.goreleaser.brew.combined.yml --release-notes="${{env.RELEASE_NOTES_FILE}}" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.customToken }} | ||
PRE_RELEASE_ID: | ||
|
||
- name: GoReleaser Release Candidate | ||
if: ${{ inputs.isReleaseCandidate }} | ||
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 #v5.0.0 | ||
with: | ||
version: v1.24.0 | ||
args: release --clean --timeout 60m --skip=validate --config=.github/.goreleaser.yaml --release-notes="${{env.RELEASE_NOTES_FILE}}" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.customToken }} | ||
PRE_RELEASE_ID: ${{steps.vars.outputs.PRE_RELEASE_ID}} | ||
|
||
- name: get version | ||
id: get_version | ||
run: echo "version=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Release - Test, build and start publishing | ||
on: | ||
push: | ||
tags: | ||
- '[0-9]+.[0-9]+.[0-9]+*' | ||
|
||
jobs: | ||
test-and-build: | ||
uses: ./.github/workflows/test-and-build.yaml | ||
check-tag: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
isRc: ${{ steps.vars.outputs.isRc }} | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 | ||
- name: Set output | ||
id: vars | ||
run: | | ||
case ${GITHUB_REF#refs/*/} in | ||
*-rc.*) | ||
echo 'isRc=true' >> $GITHUB_OUTPUT | ||
;; | ||
*) | ||
echo 'isRc=false' >> $GITHUB_OUTPUT | ||
;; | ||
esac | ||
publish-release-candidate: | ||
name: Publish GitHub release candidate | ||
uses: ./.github/workflows/publish-release.yaml | ||
needs: [test-and-build, check-tag] | ||
with: | ||
isReleaseCandidate: ${{ needs.check-tag.outputs.isRc == 'true' }} | ||
name: release candidate | ||
secrets: | ||
customToken: ${{ secrets.EKSCTLBOT_TOKEN }} | ||
permissions: | ||
contents: write | ||
pull-requests: write |
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 |
---|---|---|
|
@@ -2,7 +2,6 @@ github.com/maxbrunsfeld/counterfeiter/v6 | |
github.com/cloudflare/cfssl/cmd/[email protected] | ||
github.com/cloudflare/cfssl/cmd/[email protected] | ||
github.com/golangci/golangci-lint/cmd/golangci-lint | ||
github.com/goreleaser/goreleaser | ||
github.com/onsi/ginkgo/v2/[email protected] | ||
github.com/vektra/mockery/v2 | ||
github.com/github-release/github-release | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
9b3f575ceb1a272a000ca1fbaded0174096a007a | ||
79ff6e4d9b5ba7e2bfb962efe2fcb7b2eebc1f2a |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.