v2.10.0 #18
Workflow file for this run
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
name: gardenctl-updater | |
on: | |
release: | |
types: | |
- published | |
jobs: | |
update_gardenctl_in_homebrew_tap_and_chocolatey_packages: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 | |
with: | |
go-version: '1.21.6' | |
- name: Build the binary-files | |
id: build_binary_files | |
run: | | |
sudo apt-get update | |
sudo apt-get install make -y | |
make build | |
echo "latest_release_filtered_tag=${GITHUB_REF##*/}" >> $GITHUB_ENV | |
- name: Upload binaries to release | |
uses: AButler/upload-release-assets@c94805dc72e4b20745f543da0f62eaee7722df7a # v2.0.2 | |
with: | |
files: 'bin/darwin-amd64/gardenctl_v2_darwin_amd64;bin/darwin-arm64/gardenctl_v2_darwin_arm64;bin/linux-amd64/gardenctl_v2_linux_amd64;bin/linux-arm64/gardenctl_v2_linux_arm64;bin/windows-amd64/gardenctl_v2_windows_amd64.exe' | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
release-tag: ${{ env.latest_release_filtered_tag }} | |
- name: Get token for gardener-github-pkg-mngr app | |
if: github.event.release.prerelease == false | |
id: gardener-github-workflows | |
uses: getsentry/action-github-app-token@d4b5da6c5e37703f8c3b3e43abb5705b46e159cc # v3.0.0 | |
with: | |
app_id: ${{ secrets.GARDENER_GITHUB_WORKFLOW_PKG_MNGR_APP_ID }} | |
private_key: ${{ secrets.GARDENER_GITHUB_WORKFLOW_PKG_MNGR_APP_PRIVATE_KEY }} | |
- name: Send update with latest versions to ${{ github.repository_owner }}/homebrew-tap | |
if: github.event.release.prerelease == false | |
run: | | |
latest_release_filtered_tag=${{ env.latest_release_filtered_tag }} | |
darwin_sha256sum_amd64=$(sha256sum bin/darwin-amd64/gardenctl_v2_darwin_amd64 | awk '{print $1}') | |
darwin_sha256sum_arm64=$(sha256sum bin/darwin-arm64/gardenctl_v2_darwin_arm64 | awk '{print $1}') | |
linux_sha256sum_amd64=$(sha256sum bin/linux-amd64/gardenctl_v2_linux_amd64 | awk '{print $1}') | |
linux_sha256sum_arm64=$(sha256sum bin/linux-arm64/gardenctl_v2_linux_arm64 | awk '{print $1}') | |
data='{"event_type": "update", "client_payload": { "component": "gardenctl-v2", "tag": "'"$latest_release_filtered_tag"'", "darwin_sha_amd64": "'"$darwin_sha256sum_amd64"'", "darwin_sha_arm64": "'"$darwin_sha256sum_arm64"'", "linux_sha_amd64": "'"$linux_sha256sum_amd64"'", "linux_sha_arm64": "'"$linux_sha256sum_arm64"'"}}' | |
echo "${data}" | |
curl -X POST https://api.github.com/repos/${{ github.repository_owner }}/homebrew-tap/dispatches \ | |
-H 'Accept: application/vnd.github.everest-preview+json' \ | |
-H "Authorization: Token ${{ steps.gardener-github-workflows.outputs.token }}" \ | |
--data "${data}" | |
- name: Send update with latest versions to ${{ github.repository_owner }}/chocolatey-packages | |
if: github.event.release.prerelease == false | |
run: | | |
latest_release_filtered_tag=${{ env.latest_release_filtered_tag }} | |
windows_sha256sum=$(sha256sum bin/windows-amd64/gardenctl_v2_windows_amd64.exe | awk '{print $1}') | |
data='{"event_type": "update", "client_payload": { "component": "gardenctl-v2", "tag": "'"$latest_release_filtered_tag"'", "windows_sha": "'"$windows_sha256sum"'"}}' | |
echo "${data}" | |
curl -X POST https://api.github.com/repos/${{ github.repository_owner }}/chocolatey-packages/dispatches \ | |
-H 'Accept: application/vnd.github.everest-preview+json' \ | |
-H "Authorization: Token ${{ steps.gardener-github-workflows.outputs.token }}" \ | |
--data "${data}" |