File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed
Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -19,12 +19,36 @@ jobs:
1919 uses : actions/setup-go@v5
2020 with :
2121 go-version : ' 1.25'
22+ cache : true
2223
2324 - name : Test
2425 run : go test -v ./...
2526
2627 - name : Setup ko
27- uses : ko-build/setup-ko@v0.9
28+ run : |
29+ set -ex
30+
31+ # Get latest ko release
32+ tag=$(curl -L -s -u "username:${{ github.token }}" https://api.github.com/repos/ko-build/ko/releases/latest | jq -r '.tag_name')
33+
34+ os=${{ runner.os }}
35+ arch=$(echo "${{ runner.arch }}" | tr '[:upper:]' '[:lower:]')
36+ if [[ $os == "macOS" ]]; then
37+ os="Darwin"
38+ fi
39+ if [[ $arch == "x64" ]]; then
40+ arch="x86_64"
41+ fi
42+
43+ echo "Installing ko @ ${tag} for ${os} ${arch}"
44+ curl -fsL https://github.com/ko-build/ko/releases/download/${tag}/ko_${tag:1}_${os}_${arch}.tar.gz | sudo tar xzf - -C /usr/local/bin ko
45+
46+ # Login to ghcr.io
47+ echo "${{ github.token }}" | ko login ghcr.io --username "dummy" --password-stdin
48+
49+ # Set KO_DOCKER_REPO
50+ repo=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
51+ echo "KO_DOCKER_REPO=ghcr.io/${repo}" >> $GITHUB_ENV
2852
2953 - name : Build and push
3054 run : |
You can’t perform that action at this time.
0 commit comments