Merge branch 'anaganisk:master' into master
This commit is contained in:
commit
684cdc3a3d
@ -10,6 +10,7 @@ jobs:
|
|||||||
name: Build
|
name: Build
|
||||||
command: |
|
command: |
|
||||||
./ci-build-script.sh .
|
./ci-build-script.sh .
|
||||||
|
cp ./digitalocean-dynamic-ip.sample.json ./releases/
|
||||||
- persist_to_workspace:
|
- persist_to_workspace:
|
||||||
root: .
|
root: .
|
||||||
paths:
|
paths:
|
||||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -5,4 +5,4 @@ digitalocean-dynamic-ip.json
|
|||||||
|
|
||||||
# GoLand IDE
|
# GoLand IDE
|
||||||
.idea/
|
.idea/
|
||||||
releases
|
releases
|
||||||
|
@ -6,18 +6,28 @@ if [[ -z "$package" ]]; then
|
|||||||
fi
|
fi
|
||||||
package_split=(${package//\// })
|
package_split=(${package//\// })
|
||||||
package_name=${package_split[-1]}
|
package_name=${package_split[-1]}
|
||||||
platforms=("windows/amd64" "windows/386" "darwin/amd64" "linux/386" "linux/amd64" "linux/arm" "linux/arm64")
|
#see https://en.wikipedia.org/wiki/Raspberry_Pi#Specifications for RPi arm versions
|
||||||
mkdir releases
|
#see https://github.com/golang/go/wiki/GoArm
|
||||||
|
platforms=("windows/amd64" "windows/386" "darwin/amd64" "linux/386" "linux/amd64" "linux/arm/6" "linux/arm/7" "linux/arm64/8" "freebsd/386" "freebsd/amd64")
|
||||||
|
mkdir -p releases
|
||||||
for platform in "${platforms[@]}"
|
for platform in "${platforms[@]}"
|
||||||
do
|
do
|
||||||
platform_split=(${platform//\// })
|
platform_split=(${platform//\// })
|
||||||
GOOS=${platform_split[0]}
|
GOOS=${platform_split[0]}
|
||||||
GOARCH=${platform_split[1]}
|
GOARCH=${platform_split[1]}
|
||||||
|
GOARM=${platform_split[2]}
|
||||||
output_name='digitalocean-dynamic-dns-ip-'$GOOS'-'$GOARCH
|
output_name='digitalocean-dynamic-dns-ip-'$GOOS'-'$GOARCH
|
||||||
|
if [[ ! -z "$GOARM" ]]; then
|
||||||
|
output_name+="v${GOARM}"
|
||||||
|
# arm v8 is only supported for ARCH=arm64 and requires an empty GOARM version
|
||||||
|
if [[ "8" -eq "$GOARM" ]]; then
|
||||||
|
GOARM=""
|
||||||
|
fi
|
||||||
|
fi
|
||||||
if [ $GOOS = "windows" ]; then
|
if [ $GOOS = "windows" ]; then
|
||||||
output_name+='.exe'
|
output_name+='.exe'
|
||||||
fi
|
fi
|
||||||
env GOOS=$GOOS GOARCH=$GOARCH go build -o releases/$output_name $package_name
|
env GOOS="$GOOS" GOARCH="$GOARCH" GOARM="$GOARM" go build -o "releases/$output_name" "$package_name"
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo 'An error has occurred! Aborting the script execution...'
|
echo 'An error has occurred! Aborting the script execution...'
|
||||||
exit 1
|
exit 1
|
||||||
|
Loading…
Reference in New Issue
Block a user