-
Notifications
You must be signed in to change notification settings - Fork 19
provided support for windows arm64 #92
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -43,14 +43,16 @@ echo "Building windows/amd64..." | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -trimpath -ldflags "${BUILD_FLAGS}" -o "$BUILD_DIR/${BINARY_NAME}-${VERSION}-windows-amd64.exe" main.go | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Building windows/386..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -trimpath -ldflags "${BUILD_FLAGS}" -o "$BUILD_DIR/${BINARY_NAME}-${VERSION}-windows-386.exe" main.go | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Building windows/arm64..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build -trimpath -ldflags "${BUILD_FLAGS}" -o "$BUILD_DIR/${BINARY_NAME}-${VERSION}-windows-arm64.exe" main.go | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Verify all binaries were created | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Verifying binaries..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| MISSING_BINARIES=() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for binary in "${BINARY_NAME}-${VERSION}-darwin-amd64" "${BINARY_NAME}-${VERSION}-darwin-arm64" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "${BINARY_NAME}-${VERSION}-linux-amd64" "${BINARY_NAME}-${VERSION}-linux-arm64" "${BINARY_NAME}-${VERSION}-linux-386" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "${BINARY_NAME}-${VERSION}-windows-amd64.exe" "${BINARY_NAME}-${VERSION}-windows-386.exe"; do | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "${BINARY_NAME}-${VERSION}-windows-amd64.exe" "${BINARY_NAME}-${VERSION}-windows-386.exe" "${BINARY_NAME}-${VERSION}-windows-arm64.exe"; do | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [[ ! -f "$BUILD_DIR/$binary" ]]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| MISSING_BINARIES+=("$binary") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -83,12 +85,22 @@ echo "Creating windows archives..." | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if command -v zip >/dev/null 2>&1; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (cd "$BUILD_DIR" && zip "${PACKAGE_NAME}-${VERSION}-windows-amd64.zip" "${BINARY_NAME}-${VERSION}-windows-amd64.exe") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (cd "$BUILD_DIR" && zip "${PACKAGE_NAME}-${VERSION}-windows-386.zip" "${BINARY_NAME}-${VERSION}-windows-386.exe") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (cd "$BUILD_DIR" && zip "${PACKAGE_NAME}-${VERSION}-windows-arm64.zip" "${BINARY_NAME}-${VERSION}-windows-arm64.exe") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Warning: zip command not found, skipping Windows archives" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Warning: zip command not found, falling back to tar.gz for Windows" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: The fallback branch uses |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tar czf "$BUILD_DIR/${PACKAGE_NAME}-${VERSION}-windows-amd64.tar.gz" -C "$BUILD_DIR" "${BINARY_NAME}-${VERSION}-windows-amd64.exe" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tar czf "$BUILD_DIR/${PACKAGE_NAME}-${VERSION}-windows-386.tar.gz" -C "$BUILD_DIR" "${BINARY_NAME}-${VERSION}-windows-386.exe" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tar czf "$BUILD_DIR/${PACKAGE_NAME}-${VERSION}-windows-arm64.tar.gz" -C "$BUILD_DIR" "${BINARY_NAME}-${VERSION}-windows-arm64.exe" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Generate checksums | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Generating checksums..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (cd "$BUILD_DIR" && shasum -a 256 * > "${PACKAGE_NAME}-${VERSION}-checksums.txt") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if command -v shasum >/dev/null 2>&1; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (cd "$BUILD_DIR" && shasum -a 256 * > "${PACKAGE_NAME}-${VERSION}-checksums.txt") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should Fix: The shasum -a 256 *.tar.gz *.zip > "${PACKAGE_NAME}-${VERSION}-checksums.txt"(Same applies to the Note: this is a pre-existing issue on |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| elif command -v sha256sum >/dev/null 2>&1; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (cd "$BUILD_DIR" && sha256sum * > "${PACKAGE_NAME}-${VERSION}-checksums.txt") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+99
to
+101
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (cd "$BUILD_DIR" && shasum -a 256 * > "${PACKAGE_NAME}-${VERSION}-checksums.txt") | |
| elif command -v sha256sum >/dev/null 2>&1; then | |
| (cd "$BUILD_DIR" && sha256sum * > "${PACKAGE_NAME}-${VERSION}-checksums.txt") | |
| ( | |
| cd "$BUILD_DIR" || exit 1 | |
| artifacts=() | |
| for pattern in "${PACKAGE_NAME}-${VERSION}-"*.tar.gz "${PACKAGE_NAME}-${VERSION}-"*.zip; do | |
| [ -e "$pattern" ] || continue | |
| artifacts+=("$pattern") | |
| done | |
| if [ ${#artifacts[@]} -gt 0 ]; then | |
| shasum -a 256 "${artifacts[@]}" > "${PACKAGE_NAME}-${VERSION}-checksums.txt" | |
| else | |
| echo "Warning: No release archives found, skipping checksums" | |
| fi | |
| ) | |
| elif command -v sha256sum >/dev/null 2>&1; then | |
| ( | |
| cd "$BUILD_DIR" || exit 1 | |
| artifacts=() | |
| for pattern in "${PACKAGE_NAME}-${VERSION}-"*.tar.gz "${PACKAGE_NAME}-${VERSION}-"*.zip; do | |
| [ -e "$pattern" ] || continue | |
| artifacts+=("$pattern") | |
| done | |
| if [ ${#artifacts[@]} -gt 0 ]; then | |
| sha256sum "${artifacts[@]}" > "${PACKAGE_NAME}-${VERSION}-checksums.txt" | |
| else | |
| echo "Warning: No release archives found, skipping checksums" | |
| fi | |
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Must Fix: Missing newline at end of file. The PR removes the trailing newline — \ No newline at end of file appears in the diff. POSIX requires a trailing newline for well-formed text files, and many tools will warn about this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the
zip-missing branch, the script assumestaris available but doesn’t verify it. Since the script also doesn’t useset -e, a missingtarwould result in failed archive creation while the script still reaches the final “Build complete” message. Consider adding acommand -v tarcheck (and exiting non-zero if unavailable) before attempting the Windows tar.gz fallback so failures are explicit.