-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Builds binaries for Windows, macOS and Linux - Shrinks the binaries with additional linker flags + Do the same in the CI configuration files
- Loading branch information
1 parent
d25e404
commit 95fa875
Showing
5 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ install: | |
|
||
build_script: | ||
- go build | ||
- .\build.ps1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ go: | |
|
||
script: | ||
- go build | ||
- ./build.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
$ErrorActionPreference = "Stop" | ||
|
||
# Clean up the previous build | ||
If (Test-Path "${PSScriptRoot}\artifacts") {Remove-Item -Recurse -Force "${PSScriptRoot}\artifacts"} | ||
|
||
# Build for Windows, macOS and Linux | ||
# Use linker flags for shrinking | ||
set GOOS=linux | ||
go build -o "${PSScriptRoot}\artifacts\serve_Windows_x64.exe" -ldflags="-s -w" "github.com/philippgille/serve" | ||
set GOOS=linux | ||
go build -o "${PSScriptRoot}\artifacts\serve_macOS_x64" -ldflags="-s -w" "github.com/philippgille/serve" | ||
set GOOS=linux | ||
go build -o ${PSScriptRoot}\"artifacts\serve_Linux_x64" -ldflags="-s -w" "github.com/philippgille/serve" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
set -euxo pipefail | ||
|
||
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
# Clean up the previous build | ||
rm -rf $SCRIPTDIR/artifacts | ||
|
||
# Build for Windows, macOS and Linux | ||
# Use linker flags for shrinking | ||
GOOS=windows go build -o "$SCRIPTDIR/artifacts/serve_Windows_x64.exe" -ldflags="-s -w" "github.com/philippgille/serve" | ||
GOOS=darwin go build -o "$SCRIPTDIR/artifacts/serve_macOS_x64" -ldflags="-s -w" "github.com/philippgille/serve" | ||
GOOS=linux go build -o "$SCRIPTDIR/artifacts/serve_Linux_x64" -ldflags="-s -w" "github.com/philippgille/serve" |