Skip to content

Commit 81a825e

Browse files
authored
Merge pull request #18 from nginxinc/areste
Build Windows targets
2 parents 1ebb2a4 + c472c28 commit 81a825e

File tree

3 files changed

+26
-16
lines changed

3 files changed

+26
-16
lines changed

.github/workflows/go-builder.yml

+13-15
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,19 @@ jobs:
2020
run: |
2121
BUILD=$(git log --format='%H' -n 1)
2222
VERSION="dev"
23-
GOOS=linux GOARCH=amd64 go build -ldflags "-w -s -X github.com/nginxinc/nginx-k8s-supportpkg/pkg/version.Build=$BUILD\
24-
-X github.com/nginxinc/nginx-k8s-supportpkg/pkg/version.Version=$VERSION" -o release/kubectl-nginx_supportpkg
25-
tar czvf release/kubectl-nginx-supportpkg_${VERSION}_linux_amd64.tar.gz -C release kubectl-nginx_supportpkg
26-
27-
GOOS=linux GOARCH=arm64 go build -ldflags "-w -s -X github.com/nginxinc/nginx-k8s-supportpkg/pkg/version.Build=$BUILD\
28-
-X github.com/nginxinc/nginx-k8s-supportpkg/pkg/version.Version=$VERSION" -o release/kubectl-nginx_supportpkg
29-
tar czvf release/kubectl-nginx-supportpkg_${VERSION}_linux_arm64.tar.gz -C release kubectl-nginx_supportpkg
30-
31-
GOOS=darwin GOARCH=amd64 go build -ldflags "-w -s -X github.com/nginxinc/nginx-k8s-supportpkg/pkg/version.Build=$BUILD\
32-
-X github.com/nginxinc/nginx-k8s-supportpkg/pkg/version.Version=$VERSION" -o release/kubectl-nginx_supportpkg
33-
tar czvf release/kubectl-nginx-supportpkg_${VERSION}_darwin_amd64.tar.gz -C release kubectl-nginx_supportpkg
34-
35-
GOOS=darwin GOARCH=arm64 go build -ldflags "-w -s -X github.com/nginxinc/nginx-k8s-supportpkg/pkg/version.Build=$BUILD\
36-
-X github.com/nginxinc/nginx-k8s-supportpkg/pkg/version.Version=$VERSION" -o release/kubectl-nginx_supportpkg
37-
tar czvf release/kubectl-nginx-supportpkg_${VERSION}_darwin_arm64.tar.gz -C release kubectl-nginx_supportpkg
23+
OSES="linux darwin windows"
24+
ARCHS="amd64 arm64"
25+
IFS=" "
26+
27+
for OS in $OSES; do
28+
for ARCH in $ARCHS; do
29+
echo "OS: ${OS} and ARCH: ${ARCH}"
30+
GOOS=${OS} GOARCH=${ARCH} go build -ldflags "-w -s -X github.com/nginxinc/nginx-k8s-supportpkg/pkg/version.Build=$BUILD\
31+
-X github.com/nginxinc/nginx-k8s-supportpkg/pkg/version.Version=$VERSION"\
32+
-o release/kubectl-nginx_supportpkg_${VERSION}_${OS}_${ARCH}/kubectl-nginx_supportpkg
33+
cp LICENSE release/kubectl-nginx_supportpkg_${VERSION}_${OS}_${ARCH}/
34+
tar czvf release/kubectl-nginx_supportpkg_${VERSION}_${OS}_${ARCH}.tar.gz -C release/kubectl-nginx_supportpkg_${VERSION}_${OS}_${ARCH}/ .
35+
done; done
3836
3937
- name: Upload Artifacts
4038
uses: actions/upload-artifact@v4

.github/workflows/release-builder.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
run: |
2828
BUILD=$(git log --format='%H' -n 1)
2929
VERSION=$RELEASE_VERSION
30-
OSES="linux darwin"
30+
OSES="linux darwin windows"
3131
ARCHS="amd64 arm64"
3232
IFS=" "
3333

.krew.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@ spec:
2929
arch: amd64
3030
{{addURIAndSha "https://github.com/nginxinc/nginx-supportpkg-for-k8s/releases/download/{{ .TagName }}/kubectl-nginx_supportpkg_{{ .TagName }}_darwin_amd64.tar.gz" .TagName }}
3131
bin: kubectl-nginx_supportpkg
32+
- selector:
33+
matchLabels:
34+
os: windows
35+
arch: amd64
36+
{{addURIAndSha "https://github.com/nginxinc/nginx-supportpkg-for-k8s/releases/download/{{ .TagName }}/kubectl-nginx_supportpkg_{{ .TagName }}_windows_amd64.tar.gz" .TagName }}
37+
bin: kubectl-nginx_supportpkg
38+
- selector:
39+
matchLabels:
40+
os: windows
41+
arch: arm64
42+
{{addURIAndSha "https://github.com/nginxinc/nginx-supportpkg-for-k8s/releases/download/{{ .TagName }}/kubectl-nginx_supportpkg_{{ .TagName }}_windows_arm64.tar.gz" .TagName }}
43+
bin: kubectl-nginx_supportpkg
3244
shortDescription: Collect support packages for NGINX products that run on k8s
3345
homepage: https://github.com/nginxinc/nginx-supportpkg-for-k8s
3446
description: |

0 commit comments

Comments
 (0)