Skip to content

Commit

Permalink
Add windows build to .goreleaser.yaml and Makefile, untrack powershel…
Browse files Browse the repository at this point in the history
…l scripts
  • Loading branch information
ZigaMr committed Jan 8, 2025
1 parent 8803d2a commit d5fd673
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 306 deletions.
36 changes: 0 additions & 36 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,39 +49,3 @@ jobs:
make examples
git diff --exit-code examples
tests-windows:
name: tests-windows-latest
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22.x"

- name: Cache Go dependencies
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build code
shell: pwsh
run: |
.\win_setup.ps1 build
- name: Run tests
shell: pwsh
run: |
.\win_setup.ps1 test
- name: Check examples
shell: pwsh
run: |
.\win_setup.ps1 clean-examples
.\win_setup.ps1 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
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ clean:
rm -f oasis
$(GO) clean -testcache

windows-build:
@$(PRINT) "$(MAGENTA)*** Building for Windows...$(OFF)\n"
GOOS=windows GOARCH=amd64 $(GO) build -v -o oasis.exe $(GOFLAGS) $(GO_EXTRA_FLAGS)

# List of targets that are not actual files.
.PHONY: \
all build \
Expand All @@ -83,3 +87,4 @@ clean:
$(lint-targets) lint \
$(test-targets) test \
clean
windows
100 changes: 0 additions & 100 deletions scripts/gen_example.ps1

This file was deleted.

170 changes: 0 additions & 170 deletions win_setup.ps1

This file was deleted.

0 comments on commit d5fd673

Please sign in to comment.