Skip to content
Closed
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
16 changes: 16 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ builds:
- arm64
ldflags: *build-ldflags

- id: windows-build
binary: mass
env:
- CGO_ENABLED=0
goos:
- windows
goarch:
- amd64
- arm64
ldflags: *build-ldflags
Comment on lines +31 to +40
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows artifacts are now part of the release configuration, but the CI workflows only build/test on ubuntu-latest. To avoid shipping broken Windows binaries, add a CI check that at least compiles (and ideally tests) with GOOS=windows / a Windows runner as part of PR validation.

Copilot uses AI. Check for mistakes.

archives:
- id: linux-archives
builds:
Expand All @@ -39,6 +50,11 @@ archives:
- darwin-build
name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}"

- id: windows-archives
builds:
- windows-build
name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}"

checksum:
name_template: 'checksums.txt'

Expand Down
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ build:
$(MAKE) build.macos; \
elif [ "$$(uname -s)" = "Linux" ]; then \
$(MAKE) build.linux; \
elif echo "$$(uname -s)" | grep -q -E "^(MINGW|MSYS|Windows)"; then \
$(MAKE) build.windows; \
else \
echo "Error: Unsupported operating system. Please use 'make build.macos' or 'make build.linux' directly."; \
echo "Error: Unsupported operating system. Please use 'make build.macos', 'make build.linux', or 'make build.windows' directly."; \
exit 1; \
fi

Expand All @@ -67,6 +69,10 @@ build.macos: bin
build.linux: bin
GOOS=linux GOARCH=amd64 go build -o bin/mass-linux-amd64 -ldflags=${LD_FLAGS}

.PHONY: build.windows
build.windows: bin
GOOS=windows GOARCH=amd64 go build -o bin/mass-windows-amd64.exe -ldflags=${LD_FLAGS}

Comment on lines +72 to +75
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build.windows only builds GOARCH=amd64, but release artifacts are configured to build Windows for both amd64 and arm64 in .goreleaser.yaml. Consider either adding a build.windows.arm64 target (or making GOARCH configurable) so local builds match the supported/released architectures.

Suggested change
.PHONY: build.windows
build.windows: bin
GOOS=windows GOARCH=amd64 go build -o bin/mass-windows-amd64.exe -ldflags=${LD_FLAGS}
.PHONY: build.windows build.windows.amd64 build.windows.arm64
build.windows: build.windows.amd64 build.windows.arm64
build.windows.amd64: bin
GOOS=windows GOARCH=amd64 go build -o bin/mass-windows-amd64.exe -ldflags=${LD_FLAGS}
build.windows.arm64: bin
GOOS=windows GOARCH=arm64 go build -o bin/mass-windows-arm64.exe -ldflags=${LD_FLAGS}

Copilot uses AI. Check for mistakes.
.PHONY: install.macos
install.macos: build.macos
rm -f ${INSTALL_PATH}/mass
Expand Down
7 changes: 6 additions & 1 deletion cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"os"
"os/signal"
"path"
"runtime"
"strings"
"syscall"
"time"
Expand Down Expand Up @@ -127,7 +128,11 @@ func setupLogging(level string) {

func handleSignals(ctx context.Context, s *server.BundleServer) {
c := make(chan os.Signal, 2)
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
signals := []os.Signal{os.Interrupt}
if runtime.GOOS != "windows" {
signals = append(signals, syscall.SIGTERM)
}
signal.Notify(c, signals...)
go func(s *server.BundleServer) {
for sig := range c {
slog.Info("Shutting down", "signal", sig)
Expand Down
1 change: 1 addition & 0 deletions pkg/bundle/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func (p *Publisher) PackageBundle(ctx context.Context, bundleDir string, tag str
if err != nil {
return err
}
bundleRelativePath = filepath.ToSlash(bundleRelativePath)

if ignoreMatcher != nil && ignoreMatcher.MatchesPath(bundleRelativePath) {
return nil
Expand Down