Skip to content

Commit

Permalink
Add build-windows to Makefile
Browse files Browse the repository at this point in the history
Add powershell script for Windows build

Add windows tests to CI

Add error handling for missing config

Update .github/workflows/ci-tests.yml

Co-authored-by: Matevž Jekovec <[email protected]>

Add Win build to goreleaser and Makefile, untrack powershell scripts

Update build-windows in makefile
  • Loading branch information
ZigaMr committed Jan 10, 2025
1 parent 9c0a745 commit 782497c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ jobs:
run: |
make clean-examples
make examples
git diff --exit-code examples
git diff --exit-code examples
14 changes: 14 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ builds:
- darwin
goarch:
- arm64
- <<: *build-common
id: oasis-windows-amd64
binary: oasis.exe
env:
- CC=x86_64-w64-mingw32-gcc
- CXX=x86_64-w64-mingw32-g++
goos:
- windows
goarch:
- amd64

archives:
- name_template: "{{replace .ProjectName \" \" \"_\" | tolower}}_{{.Version}}_{{.Os}}_{{.Arch}}"
Expand All @@ -66,6 +76,10 @@ archives:
- oasis-linux-amd64
- oasis-linux-arm64
- oasis-darwin-universal
- oasis-windows-amd64
format_overrides:
- goos: windows
format: zip

checksum:
name_template: SHA256SUMS-{{.Version}}.txt
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ all: build

# Build.
build: oasis

build-windows: $(shell find . -name "*.go" -type f) go.sum go.mod
@$(PRINT) "$(MAGENTA)*** Building for Windows...$(OFF)\n"
GOOS=windows GOARCH=amd64 $(GO) build -v -o oasis.exe $(GOFLAGS) $(GO_EXTRA_FLAGS)

oasis: $(shell find . -name "*.go" -type f) go.sum go.mod
@$(PRINT) "$(MAGENTA)*** Building Go code...$(OFF)\n"
@$(GO) build -v -o oasis $(GOFLAGS) $(GO_EXTRA_FLAGS)
Expand Down Expand Up @@ -83,3 +88,4 @@ clean:
$(lint-targets) lint \
$(test-targets) test \
clean
windows

0 comments on commit 782497c

Please sign in to comment.