Skip to content

Commit

Permalink
Merge pull request #69 from gatewayd-io/add-windows-support
Browse files Browse the repository at this point in the history
Add windows support
  • Loading branch information
mostafa authored Dec 3, 2023
2 parents 81fb229 + 3498a30 commit 9bda57a
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 81 deletions.
36 changes: 17 additions & 19 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# Windows build is disabled due to the following issue:
# https://github.com/gatewayd-io/gatewayd-plugin-cache/issues/58
os: [ubuntu-latest, macos-latest] #, windows-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -37,24 +35,24 @@ jobs:
elif [ "$RUNNER_OS" == "macOS" ]; then
make build-release-darwin
fi
# - name: Build and release binaries
# if: matrix.os == 'windows-latest'
# run: |
# make build-release-windows
- name: Build and release binaries
if: matrix.os == 'windows-latest'
run: |
make build-release-windows
- name: Upload binaries and checksums
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
name: dist-${{ matrix.os }}
if-no-files-found: warn
# - name: Upload binaries and checksums
# if: matrix.os == 'windows-latest'
# uses: actions/upload-artifact@v3
# with:
# path: dist/*.zip
# name: dist-${{ matrix.os }}
# if-no-files-found: warn
- name: Upload binaries and checksums
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v3
with:
path: dist/*.zip
name: dist-${{ matrix.os }}
if-no-files-found: warn
release:
needs: build
runs-on: ubuntu-latest
Expand All @@ -63,10 +61,10 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
# - name: Download binaries and checksums for Windows
# uses: actions/download-artifact@v3
# with:
# name: dist-windows-latest
- name: Download binaries and checksums for Windows
uses: actions/download-artifact@v3
with:
name: dist-windows-latest
- name: Download binaries and checksums for Linux
uses: actions/download-artifact@v3
with:
Expand All @@ -83,7 +81,7 @@ jobs:
files: |
*.tar.gz
checksums.txt
# *.zip
*.zip
draft: false
prerelease: false
tag_name: ${{ github.ref_name }}
Expand Down
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ update-all:
@go get -u ./...

build-dev: tidy
@go build
@CGO_ENABLED=0 go build

create-build-dir:
@mkdir -p dist
Expand All @@ -29,7 +29,7 @@ build-linux-amd64: tidy
@echo "Building gatewayd ${VERSION} for linux-amd64"
@mkdir -p dist/linux-amd64
@cp README.md LICENSE gatewayd_plugin.yaml ./dist/linux-amd64/
@GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build -trimpath -ldflags "-s -w ${EXTRA_LDFLAGS}" -o dist/linux-amd64/gatewayd-plugin-cache
@GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -trimpath -ldflags "-s -w ${EXTRA_LDFLAGS}" -o dist/linux-amd64/gatewayd-plugin-cache
@sha256sum dist/linux-amd64/gatewayd-plugin-cache | sed 's/dist\/linux-amd64\///g' >> dist/linux-amd64/checksum.txt
@tar czf dist/gatewayd-plugin-cache-linux-amd64-${VERSION}.tar.gz -C ./dist/linux-amd64/ ${FILES}
@sha256sum dist/gatewayd-plugin-cache-linux-amd64-${VERSION}.tar.gz | sed 's/dist\///g' >> dist/checksums.txt
Expand All @@ -38,7 +38,7 @@ build-linux-arm64:
@echo "Building gatewayd ${VERSION} for linux-arm64"
@mkdir -p dist/linux-arm64
@cp README.md LICENSE gatewayd_plugin.yaml ./dist/linux-arm64/
@GOOS=linux GOARCH=arm64 CGO_ENABLED=1 CC=aarch64-linux-gnu-gcc go build -trimpath -ldflags "-s -w ${EXTRA_LDFLAGS}" -o dist/linux-arm64/gatewayd-plugin-cache
@GOOS=linux GOARCH=arm64 CGO_ENABLED=0 CC=aarch64-linux-gnu-gcc go build -trimpath -ldflags "-s -w ${EXTRA_LDFLAGS}" -o dist/linux-arm64/gatewayd-plugin-cache
@sha256sum dist/linux-arm64/gatewayd-plugin-cache | sed 's/dist\/linux-arm64\///g' >> dist/linux-arm64/checksum.txt
@tar czf dist/gatewayd-plugin-cache-linux-arm64-${VERSION}.tar.gz -C ./dist/linux-arm64/ ${FILES}
@sha256sum dist/gatewayd-plugin-cache-linux-arm64-${VERSION}.tar.gz | sed 's/dist\///g' >> dist/checksums.txt
Expand All @@ -47,7 +47,7 @@ build-darwin-amd64:
@echo "Building gatewayd ${VERSION} for darwin-arm64"
@mkdir -p dist/darwin-amd64
@cp README.md LICENSE gatewayd_plugin.yaml ./dist/darwin-amd64/
@GOOS=darwin GOARCH=amd64 CGO_ENABLED=1 go build -trimpath -ldflags "-s -w ${EXTRA_LDFLAGS}" -o dist/darwin-amd64/gatewayd-plugin-cache
@GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -trimpath -ldflags "-s -w ${EXTRA_LDFLAGS}" -o dist/darwin-amd64/gatewayd-plugin-cache
@shasum -a 256 dist/darwin-amd64/gatewayd-plugin-cache | sed 's/dist\/darwin-amd64\///g' >> dist/darwin-amd64/checksum.txt
@tar czf dist/gatewayd-plugin-cache-darwin-amd64-${VERSION}.tar.gz -C ./dist/darwin-amd64/ ${FILES}
@shasum -a 256 dist/gatewayd-plugin-cache-darwin-amd64-${VERSION}.tar.gz | sed 's/dist\///g' >> dist/checksums.txt
Expand All @@ -56,7 +56,7 @@ build-darwin-arm64:
@echo "Building gatewayd ${VERSION} for darwin-arm64"
@mkdir -p dist/darwin-arm64
@cp README.md LICENSE gatewayd_plugin.yaml ./dist/darwin-arm64/
@GOOS=darwin GOARCH=arm64 CGO_ENABLED=1 go build -trimpath -ldflags "-s -w ${EXTRA_LDFLAGS}" -o dist/darwin-arm64/gatewayd-plugin-cache
@GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -trimpath -ldflags "-s -w ${EXTRA_LDFLAGS}" -o dist/darwin-arm64/gatewayd-plugin-cache
@shasum -a 256 dist/darwin-arm64/gatewayd-plugin-cache | sed 's/dist\/darwin-arm64\///g' >> dist/darwin-arm64/checksum.txt
@tar czf dist/gatewayd-plugin-cache-darwin-arm64-${VERSION}.tar.gz -C ./dist/darwin-arm64/ ${FILES}
@shasum -a 256 dist/gatewayd-plugin-cache-darwin-arm64-${VERSION}.tar.gz | sed 's/dist\///g' >> dist/checksums.txt
Expand All @@ -65,18 +65,18 @@ build-windows-amd64:
@echo "Building gatewayd ${VERSION} for windows-amd64"
@mkdir -p dist/windows-amd64
@cp README.md LICENSE gatewayd_plugin.yaml ./dist/windows-amd64/
@GOOS=windows GOARCH=amd64 CGO_ENABLED=1 go build -trimpath -ldflags "-s -w ${EXTRA_LDFLAGS}" -o dist/windows-amd64/gatewayd-plugin-cache.exe
@GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -trimpath -ldflags "-s -w ${EXTRA_LDFLAGS}" -o dist/windows-amd64/gatewayd-plugin-cache.exe
@sha256sum dist/windows-amd64/gatewayd-plugin-cache.exe | sed 's/dist\/windows-amd64\///g' >> dist/windows-amd64/checksum.txt
@zip -r dist/gatewayd-plugin-cache-windows-amd64-${VERSION}.zip -j ./dist/windows-amd64/ ${FILES}
@zip -r dist/gatewayd-plugin-cache-windows-amd64-${VERSION}.zip -j ./dist/windows-amd64/
@sha256sum dist/gatewayd-plugin-cache-windows-amd64-${VERSION}.zip | sed 's/dist\///g' >> dist/checksums.txt

build-windows-arm64:
@echo "Building gatewayd ${VERSION} for windows-arm64"
@mkdir -p dist/windows-arm64
@cp README.md LICENSE gatewayd_plugin.yaml ./dist/windows-arm64/
@GOOS=windows GOARCH=arm64 CGO_ENABLED=1 go build -trimpath -ldflags "-s -w ${EXTRA_LDFLAGS}" -o dist/windows-arm64/gatewayd-plugin-cache.exe
@GOOS=windows GOARCH=arm64 CGO_ENABLED=0 go build -trimpath -ldflags "-s -w ${EXTRA_LDFLAGS}" -o dist/windows-arm64/gatewayd-plugin-cache.exe
@sha256sum dist/windows-arm64/gatewayd-plugin-cache.exe | sed 's/dist\/windows-arm64\///g' >> dist/windows-arm64/checksum.txt
@zip -r dist/gatewayd-plugin-cache-windows-arm64-${VERSION}.zip -j ./dist/windows-arm64/ ${FILES}
@zip -r dist/gatewayd-plugin-cache-windows-arm64-${VERSION}.zip -j ./dist/windows-arm64/
@sha256sum dist/gatewayd-plugin-cache-windows-arm64-${VERSION}.zip | sed 's/dist\///g' >> dist/checksums.txt

build-release-linux: tidy create-build-dir build-linux-amd64 build-linux-arm64
Expand Down
22 changes: 12 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ go 1.20

require (
github.com/alicebob/miniredis/v2 v2.30.5
github.com/gatewayd-io/gatewayd-plugin-sdk v0.1.6
github.com/gatewayd-io/gatewayd-plugin-sdk v0.1.8
github.com/getsentry/sentry-go v0.25.0
github.com/go-co-op/gocron v1.35.2
github.com/go-co-op/gocron v1.36.0
github.com/go-redis/redis/v8 v8.11.5
github.com/hashicorp/go-hclog v1.5.0
github.com/hashicorp/go-plugin v1.5.2
github.com/hashicorp/go-plugin v1.6.0
github.com/jackc/pgx/v5 v5.5.0
github.com/prometheus/client_golang v1.17.0
github.com/spf13/cast v1.5.1
github.com/spf13/cast v1.6.0
github.com/stretchr/testify v1.8.4
github.com/zenizh/go-capturer v0.0.0-20211219060012-52ea6c8fed04
google.golang.org/grpc v1.59.0
Expand All @@ -24,27 +24,29 @@ require (
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/google/uuid v1.4.0 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/oklog/run v1.1.0 // indirect
github.com/pganalyze/pg_query_go/v4 v4.2.3 // indirect
github.com/pganalyze/pg_query_go/v4 v4.2.4-0.20231202022636-3c8cb1bd9d99 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.45.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/robfig/cron/v3 v3.0.1 // indirect
github.com/wasilibs/go-pgquery v0.0.0-20231202122549-dbe58a6cd4c4 // indirect
github.com/wasilibs/wazerox v0.0.0-20231117065139-b3503f4aeff6 // indirect
github.com/yuin/gopher-lua v1.1.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.14.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 9bda57a

Please sign in to comment.