Skip to content

Commit

Permalink
Merge pull request #18 from nginxinc/areste
Browse files Browse the repository at this point in the history
Build Windows targets
  • Loading branch information
dareste authored Jul 8, 2024
2 parents 1ebb2a4 + c472c28 commit 81a825e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 16 deletions.
28 changes: 13 additions & 15 deletions .github/workflows/go-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,19 @@ jobs:
run: |
BUILD=$(git log --format='%H' -n 1)
VERSION="dev"
GOOS=linux GOARCH=amd64 go build -ldflags "-w -s -X github.com/nginxinc/nginx-k8s-supportpkg/pkg/version.Build=$BUILD\
-X github.com/nginxinc/nginx-k8s-supportpkg/pkg/version.Version=$VERSION" -o release/kubectl-nginx_supportpkg
tar czvf release/kubectl-nginx-supportpkg_${VERSION}_linux_amd64.tar.gz -C release kubectl-nginx_supportpkg
GOOS=linux GOARCH=arm64 go build -ldflags "-w -s -X github.com/nginxinc/nginx-k8s-supportpkg/pkg/version.Build=$BUILD\
-X github.com/nginxinc/nginx-k8s-supportpkg/pkg/version.Version=$VERSION" -o release/kubectl-nginx_supportpkg
tar czvf release/kubectl-nginx-supportpkg_${VERSION}_linux_arm64.tar.gz -C release kubectl-nginx_supportpkg
GOOS=darwin GOARCH=amd64 go build -ldflags "-w -s -X github.com/nginxinc/nginx-k8s-supportpkg/pkg/version.Build=$BUILD\
-X github.com/nginxinc/nginx-k8s-supportpkg/pkg/version.Version=$VERSION" -o release/kubectl-nginx_supportpkg
tar czvf release/kubectl-nginx-supportpkg_${VERSION}_darwin_amd64.tar.gz -C release kubectl-nginx_supportpkg
GOOS=darwin GOARCH=arm64 go build -ldflags "-w -s -X github.com/nginxinc/nginx-k8s-supportpkg/pkg/version.Build=$BUILD\
-X github.com/nginxinc/nginx-k8s-supportpkg/pkg/version.Version=$VERSION" -o release/kubectl-nginx_supportpkg
tar czvf release/kubectl-nginx-supportpkg_${VERSION}_darwin_arm64.tar.gz -C release kubectl-nginx_supportpkg
OSES="linux darwin windows"
ARCHS="amd64 arm64"
IFS=" "
for OS in $OSES; do
for ARCH in $ARCHS; do
echo "OS: ${OS} and ARCH: ${ARCH}"
GOOS=${OS} GOARCH=${ARCH} go build -ldflags "-w -s -X github.com/nginxinc/nginx-k8s-supportpkg/pkg/version.Build=$BUILD\
-X github.com/nginxinc/nginx-k8s-supportpkg/pkg/version.Version=$VERSION"\
-o release/kubectl-nginx_supportpkg_${VERSION}_${OS}_${ARCH}/kubectl-nginx_supportpkg
cp LICENSE release/kubectl-nginx_supportpkg_${VERSION}_${OS}_${ARCH}/
tar czvf release/kubectl-nginx_supportpkg_${VERSION}_${OS}_${ARCH}.tar.gz -C release/kubectl-nginx_supportpkg_${VERSION}_${OS}_${ARCH}/ .
done; done
- name: Upload Artifacts
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run: |
BUILD=$(git log --format='%H' -n 1)
VERSION=$RELEASE_VERSION
OSES="linux darwin"
OSES="linux darwin windows"
ARCHS="amd64 arm64"
IFS=" "
Expand Down
12 changes: 12 additions & 0 deletions .krew.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ spec:
arch: amd64
{{addURIAndSha "https://github.com/nginxinc/nginx-supportpkg-for-k8s/releases/download/{{ .TagName }}/kubectl-nginx_supportpkg_{{ .TagName }}_darwin_amd64.tar.gz" .TagName }}
bin: kubectl-nginx_supportpkg
- selector:
matchLabels:
os: windows
arch: amd64
{{addURIAndSha "https://github.com/nginxinc/nginx-supportpkg-for-k8s/releases/download/{{ .TagName }}/kubectl-nginx_supportpkg_{{ .TagName }}_windows_amd64.tar.gz" .TagName }}
bin: kubectl-nginx_supportpkg
- selector:
matchLabels:
os: windows
arch: arm64
{{addURIAndSha "https://github.com/nginxinc/nginx-supportpkg-for-k8s/releases/download/{{ .TagName }}/kubectl-nginx_supportpkg_{{ .TagName }}_windows_arm64.tar.gz" .TagName }}
bin: kubectl-nginx_supportpkg
shortDescription: Collect support packages for NGINX products that run on k8s
homepage: https://github.com/nginxinc/nginx-supportpkg-for-k8s
description: |
Expand Down

0 comments on commit 81a825e

Please sign in to comment.