Skip to content

Commit

Permalink
add support for windows releases
Browse files Browse the repository at this point in the history
  • Loading branch information
wagoodman committed May 20, 2024
1 parent a28bee0 commit b9c64d9
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 19 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,20 @@ jobs:
- name: Test darwin run
run: make ci-test-mac-run

test-windows-artifacts:
needs: [ build-artifacts ]
runs-on: windows-latest
steps:
- uses: actions/checkout@master
- uses: actions/download-artifact@master
with:
name: artifacts
path: dist
- name: Test windows run
run: make ci-test-windows-run

release:
needs: [ test, build-artifacts, test-linux-artifacts, test-mac-artifacts ]
needs: [ test, build-artifacts, test-linux-artifacts, test-mac-artifacts, test-windows-artifacts ]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
Expand Down
29 changes: 17 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -107,24 +107,29 @@ ci-plugs-out-test:
"

ci-test-linux-run:
chmod 755 ./dist/go-bouncer_linux_amd64/bouncer && \
./dist/go-bouncer_linux_amd64/bouncer version && \
./dist/go-bouncer_linux_amd64/bouncer list github.com/wagoodman/go-bouncer
chmod 755 ./dist/linux-build_linux_amd64/bouncer && \
./dist/linux-build_linux_amd64/bouncer version && \
./dist/linux-build_linux_amd64/bouncer list github.com/wagoodman/go-bouncer

ci-test-linux-arm-run:
chmod 755 ./dist/go-bouncer_linux_arm64/bouncer && \
./dist/go-bouncer_linux_arm64/bouncer version && \
./dist/go-bouncer_linux_arm64/bouncer list github.com/wagoodman/go-bouncer
chmod 755 ./dist/linux-build_linux_arm64/bouncer && \
./dist/linux-build_linux_arm64/bouncer version && \
./dist/linux-build_linux_arm64/bouncer list github.com/wagoodman/go-bouncer

ci-test-mac-run:
chmod 755 ./dist/go-bouncer_darwin_amd64/bouncer && \
./dist/go-bouncer_darwin_amd64/bouncer version && \
./dist/go-bouncer_darwin_amd64/bouncer list github.com/wagoodman/go-bouncer
chmod 755 ./distdarwin-build_darwin_amd64/bouncer && \
./dist/darwin-build_darwin_amd64/bouncer version && \
./dist/darwin-build_darwin_amd64/bouncer list github.com/wagoodman/go-bouncer

ci-test-mac-arm-run:
chmod 755 ./dist/go-bouncer_darwin_arm64/bouncer && \
./dist/go-bouncer_darwin_arm64/bouncer version && \
./dist/go-bouncer_darwin_arm64/bouncer list github.com/wagoodman/go-bouncer
chmod 755 ./dist/darwin-build_darwin_arm64/bouncer && \
./dist/darwin-build_darwin_arm64/bouncer version && \
./dist/darwin-build_darwin_arm64/bouncer list github.com/wagoodman/go-bouncer

ci-test-windows-run:
chmod 755 ./dist/windows-build_windows_amd64/bouncer && \
./dist/windows-build_windows_amd64/bouncer version && \
./dist/windows-build_windows_amd64/bouncer list github.com/wagoodman/go-bouncer

ci-release: pkged.go
$(BIN)/goreleaser --rm-dist
Expand Down
1 change: 1 addition & 0 deletions bouncer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ get_binaries() {
linux/amd64) BINARIES="bouncer" ;;
darwin/arm64) BINARIES="bouncer" ;;
linux/arm64) BINARIES="bouncer" ;;
windows/amd64) BINARIES="bouncer.exe" ;;
*)
log_crit "platform $PLATFORM is not supported. Make sure this script is up-to-date and file request at https://github.com/${PREFIX}/issues/new"
exit 1
Expand Down
41 changes: 35 additions & 6 deletions goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,46 @@
release:
prerelease: auto

env:
- CGO_ENABLED=0

builds:
- binary: bouncer
env:
- CGO_ENABLED=0
- id: linux-build
binary: bouncer
goos:
- darwin
- linux
goarch:
- amd64
- arm64
ldflags: -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.buildTime={{.Date}}`.
ldflags: &build-ldflags -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.buildTime={{.Date}}`.

- id: darwin-build
binary: bouncer
goos:
- darwin
goarch:
- amd64
- arm64
ldflags: *build-ldflags

- id: windows-build
binary: bouncer
goos:
- windows
goarch:
- amd64
ldflags: *build-ldflags

archives:
- format: tar.gz
- id: linux-archives
builds:
- linux-build

- id: darwin-archives
builds:
- darwin-build

- id: windows-archives
format: zip
builds:
- windows-build

0 comments on commit b9c64d9

Please sign in to comment.