update automation scripts
This commit is contained in:
parent
b2bf3dff44
commit
a4cea48127
46
.github/workflows/Build.yml
vendored
Normal file
46
.github/workflows/Build.yml
vendored
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
name: Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: 1.17
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
#see https://en.wikipedia.org/wiki/Raspberry_Pi#Specifications for RPi arm versions
|
||||||
|
#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[@]}"
|
||||||
|
do
|
||||||
|
platform_split=(${platform//\// })
|
||||||
|
GOOS=${platform_split[0]}
|
||||||
|
GOARCH=${platform_split[1]}
|
||||||
|
GOARM=${platform_split[2]}
|
||||||
|
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
|
||||||
|
output_name+='.exe'
|
||||||
|
fi
|
||||||
|
env GOOS="$GOOS" GOARCH="$GOARCH" GOARM="$GOARM" go build -o "releases/$output_name"
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo 'An error has occurred! Aborting the script execution...'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
@ -1,4 +1,4 @@
|
|||||||
name: Go
|
name: Publish Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@ -46,8 +46,9 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
- uses: ncipollo/release-action@v1
|
- uses: ncipollo/release-action@v1
|
||||||
name: "Create Release"
|
name: "Publish Release "
|
||||||
with:
|
with:
|
||||||
|
allowUpdates: true
|
||||||
artifacts: "releases/*"
|
artifacts: "releases/*"
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user