From 33102ef7f8e8755f1bdf44c98c8833382fbbb4cc Mon Sep 17 00:00:00 2001 From: Timo Reichl Date: Mon, 2 Oct 2023 04:14:29 +0200 Subject: [PATCH] CI: Build i686 and aarch64 binaries on release Signed-off-by: Timo Reichl --- .github/workflows/release.yml | 8 +++----- scripts/build.sh | 15 +++++++++++++++ build.sh => scripts/checksums.sh | 3 --- 3 files changed, 18 insertions(+), 8 deletions(-) create mode 100755 scripts/build.sh rename build.sh => scripts/checksums.sh (77%) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9c4721d..154ae24 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,11 +33,9 @@ jobs: - name: Build binaries env: TAG_NAME: ${{ steps.branch_name.outputs.TAG_NAME }} - CGO_ENABLED: 0 - GOOS: linux - # currently only amd64 is supported - GOARCH: amd64 - run: ./build.sh + run: | + ./scripts/build.sh + ./scripts/checksums.sh - name: Create release and upload binaries uses: softprops/action-gh-release@v1 diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100755 index 0000000..218290e --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +export CGO_ENABLED=0 +export GOOS=linux + +BUILD_ARCHITECTURES="amd64/x86_64 386/i686 arm64/aarch64" + +go get + +for build_arch in ${BUILD_ARCHITECTURES}; do + export GOARCH=$(echo "${build_arch}" | cut -d '/' -f 1) + void_arch=$(echo "${build_arch}" | cut -d '/' -f 2) + + go build -ldflags="-extldflags=-static" -o bin/xdeb-install-linux-${void_arch} +done diff --git a/build.sh b/scripts/checksums.sh similarity index 77% rename from build.sh rename to scripts/checksums.sh index 559fe6c..49e7268 100755 --- a/build.sh +++ b/scripts/checksums.sh @@ -1,8 +1,5 @@ #!/bin/bash -go get -go build -ldflags="-extldflags=-static" -o bin/xdeb-install-linux-$(uname -m) - echo "# What's Changed" > bin/checksums.md echo >> bin/checksums.md