-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from join-com/more-fixes
feat: add support for other platforms
- Loading branch information
Showing
2 changed files
with
27 additions
and
3 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 |
---|---|---|
@@ -1,9 +1,30 @@ | ||
#!/bin/sh | ||
|
||
# Building binary | ||
go build -o ./dist/protoc-gen-tsx | ||
env GOOS=darwin GOARCH=amd64 go build -o ./dist/protoc-gen-tsx.darwin.amd64 | ||
env GOOS=darwin GOARCH=arm64 go build -o ./dist/protoc-gen-tsx.darwin.arm64 | ||
env GOOS=linux GOARCH=amd64 go build -o ./dist/protoc-gen-tsx.linux.amd64 | ||
env GOOS=linux GOARCH=arm64 go build -o ./dist/protoc-gen-tsx.linux.arm64 | ||
|
||
rm -f ./dist/protoc-gen-tsx; | ||
|
||
if test "$(uname)" = "Darwin" ; then | ||
if test "$(uname -m)" = "x86_64"; then | ||
cp ./dist/protoc-gen-tsx.darwin.amd64 ./dist/protoc-gen-tsx | ||
else | ||
cp ./dist/protoc-gen-tsx.darwin.arm64 ./dist/protoc-gen-tsx ## Best effort guess | ||
fi | ||
elif test "$(uname)" = "Linux" ; then | ||
if test "$(uname -m)" = "x86_64"; then | ||
cp ./dist/protoc-gen-tsx.linux.amd64 ./dist/protoc-gen-tsx | ||
else | ||
cp ./dist/protoc-gen-tsx.linux.arm64 ./dist/protoc-gen-tsx ## Best effort guess | ||
fi | ||
fi | ||
|
||
chmod a+x ./dist/* | ||
|
||
if [ "${CI}" != "true" ]; then | ||
# Stripping symbols to make the binary more lightweight | ||
strip -u -r -S ./dist/protoc-gen-tsx | ||
strip -u -r -S ./dist/protoc-gen-tsx.darwin.amd64 | ||
fi |
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