From 65f0ee7504596e3b2cb5caa631837c80fbf8b1f5 Mon Sep 17 00:00:00 2001 From: "Greg T. Wallace" Date: Fri, 2 Feb 2024 18:35:22 -0500 Subject: [PATCH] add build script --- .gitignore | 3 +++ build.ps1 | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 build.ps1 diff --git a/.gitignore b/.gitignore index 0f6d1bd..9e11ecb 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,6 @@ # ignore test_data folder /_test_data + +# build folder +/_out diff --git a/build.ps1 b/build.ps1 new file mode 100644 index 0000000..c1ba61d --- /dev/null +++ b/build.ps1 @@ -0,0 +1,18 @@ +# Parent dir is root +$scriptDir = Get-Location +$outDir = Join-Path -Path $scriptDir -ChildPath "/_out" + +# Windows x64 +$env:GOARCH = "amd64" +$env:GOOS = "windows" +go build -o $outDir/apc-p15-tool-amd64.exe ./cmd/tool + +# Linux x64 +$env:GOARCH = "amd64" +$env:GOOS = "linux" +go build -o $outDir/apc-p15-tool-amd64 ./cmd/tool + +# Linux x64 install only +$env:GOARCH = "amd64" +$env:GOOS = "linux" +go build -o $outDir/apc-p15-install-amd64 ./cmd/install_only