Skip to content

Build Windows targets #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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