This repository has been archived by the owner on Jul 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
33 lines (32 loc) · 1.7 KB
/
update-gardenctl.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: gardenctl-updater
on:
release:
types:
- published
jobs:
update_gardenctl_in_homebrew_tap:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build the binary-files
id: build_binary_files
run: |
sudo apt-get update
sudo apt-get install make -y
make build
echo ::set-output name=latest_release_filtered_tag::${GITHUB_REF##*/}
- name: Upload binaries to release
uses: AButler/upload-release-assets@v2.0
with:
files: 'bin/darwin-amd64/gardenctl-darwin-amd64;bin/linux-amd64/gardenctl-linux-amd64'
repo-token: ${{ secrets.GITHUB_TOKEN }}
release-tag: ${{ steps.build_binary_files.outputs.latest_release_filtered_tag }}
- name: Send update with latest versions to gardener/homebrew-tap
run: |
mac_sha256sum=$(sha256sum bin/darwin-amd64/gardenctl-darwin-amd64 | awk '{print $1}')
linux_sha256sum=$(sha256sum bin/linux-amd64/gardenctl-linux-amd64 | awk '{print $1}')
echo '{"event_type": "update", "client_payload": { "component": "gardenctl", "tag": "'"${{ steps.build_binary_files.outputs.latest_release_filtered_tag }}"'", "mac_sha": "'"$mac_sha256sum"'", "linux_sha": "'"$linux_sha256sum"'"}}'
curl -X POST https://api.github.com/repos/gardener/homebrew-tap/dispatches \
-H 'Accept: application/vnd.github.everest-preview+json' \
-u ${{ secrets.ACCESS_TOKEN }} \
--data '{"event_type": "update", "client_payload": { "component": "gardenctl", "tag": "'"${{ steps.build_binary_files.outputs.latest_release_filtered_tag }}"'", "mac_sha": "'"$mac_sha256sum"'", "linux_sha": "'"$linux_sha256sum"'"}}'