Skip to content

Commit 684cdc3

Browse files
authored
Merge branch 'anaganisk:master' into master
2 parents 84f2163 + e23b64e commit 684cdc3

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

.circleci/config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
name: Build
1111
command: |
1212
./ci-build-script.sh .
13+
cp ./digitalocean-dynamic-ip.sample.json ./releases/
1314
- persist_to_workspace:
1415
root: .
1516
paths:

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ digitalocean-dynamic-ip.json
55

66
# GoLand IDE
77
.idea/
8-
releases
8+
releases

ci-build-script.sh

+13-3
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,28 @@ if [[ -z "$package" ]]; then
66
fi
77
package_split=(${package//\// })
88
package_name=${package_split[-1]}
9-
platforms=("windows/amd64" "windows/386" "darwin/amd64" "linux/386" "linux/amd64" "linux/arm" "linux/arm64")
10-
mkdir releases
9+
#see https://en.wikipedia.org/wiki/Raspberry_Pi#Specifications for RPi arm versions
10+
#see https://github.com/golang/go/wiki/GoArm
11+
platforms=("windows/amd64" "windows/386" "darwin/amd64" "linux/386" "linux/amd64" "linux/arm/6" "linux/arm/7" "linux/arm64/8" "freebsd/386" "freebsd/amd64")
12+
mkdir -p releases
1113
for platform in "${platforms[@]}"
1214
do
1315
platform_split=(${platform//\// })
1416
GOOS=${platform_split[0]}
1517
GOARCH=${platform_split[1]}
18+
GOARM=${platform_split[2]}
1619
output_name='digitalocean-dynamic-dns-ip-'$GOOS'-'$GOARCH
20+
if [[ ! -z "$GOARM" ]]; then
21+
output_name+="v${GOARM}"
22+
# arm v8 is only supported for ARCH=arm64 and requires an empty GOARM version
23+
if [[ "8" -eq "$GOARM" ]]; then
24+
GOARM=""
25+
fi
26+
fi
1727
if [ $GOOS = "windows" ]; then
1828
output_name+='.exe'
1929
fi
20-
env GOOS=$GOOS GOARCH=$GOARCH go build -o releases/$output_name $package_name
30+
env GOOS="$GOOS" GOARCH="$GOARCH" GOARM="$GOARM" go build -o "releases/$output_name" "$package_name"
2131
if [ $? -ne 0 ]; then
2232
echo 'An error has occurred! Aborting the script execution...'
2333
exit 1

0 commit comments

Comments
 (0)