Skip to content

Commit

Permalink
Update build.sh
Browse files Browse the repository at this point in the history
janisar007 committed Dec 6, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 2624c39 commit 85c01e8
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#!/usr/bin/env bash

set -euo pipefail

GOMOD=$(head -1 go.mod | awk '{print $2}')
GOOS="linux" GOARCH="amd64" go build -ldflags='-s -w' -o linux/amd64/bin/main "$GOMOD/cmd/main"
GOOS="linux" GOARCH="arm64" go build -ldflags='-s -w' -o linux/arm64/bin/main "$GOMOD/cmd/main"
GOOS="linux" go build -ldflags='-s -w' -o bin/main github.com/initializ-buildpacks/procfile/v5/cmd/main
GOOS="windows" GOARCH="amd64" go build -ldflags='-s -w' -o bin/main.exe github.com/initializ-buildpacks/procfile/v5/cmd/main

if [ "${STRIP:-false}" != "false" ]; then
strip linux/amd64/bin/main linux/arm64/bin/main
strip bin/main bin/main.exe
fi

if [ "${COMPRESS:-none}" != "none" ]; then
$COMPRESS linux/amd64/bin/main linux/arm64/bin/main
$COMPRESS bin/main bin/main.exe
fi

ln -fs main linux/amd64/bin/build
ln -fs main linux/arm64/bin/build
ln -fs main linux/amd64/bin/detect
ln -fs main linux/arm64/bin/detect
ln -fs main bin/build
ln -fs main bin/detect
ln -fs main.exe bin/build.exe
ln -fs main.exe bin/detect.exe

0 comments on commit 85c01e8

Please sign in to comment.