Skip to content

Commit 124ae23

Browse files
committed
noot
1 parent 11e53d8 commit 124ae23

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

.github/workflows/build.yaml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff 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: |

0 commit comments

Comments
 (0)