From 26d28735232255c6212528e7e60a408e3e26ccb7 Mon Sep 17 00:00:00 2001 From: Mohammed Rabil <63334479+rabilrbl@users.noreply.github.com> Date: Sat, 25 Nov 2023 10:45:03 +0530 Subject: [PATCH] Update release.yml --- .github/workflows/release.yml | 38 +++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 54819340..9ecf468b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -95,25 +95,29 @@ jobs: mkdir -p bin allowed_archs="amd64 arm arm64 386" for var in $(go tool dist list); do - if [[ ! $allowed_archs =~ "$(cut -d '/' -f 2 <<<$var)" ]]; then - echo "Skipping: $var" - continue - fi - file_name="jiotv_go-${{ steps.gen_tag.outputs.tag }}-$(cut -d '/' -f 1 <<<$var)-$(cut -d '/' -f 2 <<<$var)" - case "$(cut -d '/' -f 1 <<<$var)" in - "windows") - echo "Building $var" - GOOS="$(cut -d '/' -f 1 <<<$var)" GOARCH="$(cut -d '/' -f 2 <<<$var)" go build -o bin/"$file_name.exe" -trimpath -ldflags="-s -w" ./cmd/jiotv_go - ;; + if [[ ! $allowed_archs =~ "$(cut -d '/' -f 2 <<< $var)" ]]; then + echo "Skipping: $var" + continue + fi + + file_name="jiotv_go-${{ steps.gen_tag.outputs.tag }}-$(cut -d '/' -f 1 <<< $var)-$(cut -d '/' -f 2 <<< $var)" + case "$(cut -d '/' -f 1 <<< $var)" in + "windows") + echo "Building $var" + GOOS="$(cut -d '/' -f 1 <<< $var)" GOARCH="$(cut -d '/' -f 2 <<< $var)" go build -o bin/"$file_name.exe" -trimpath -ldflags="-s -w" ./cmd/jiotv_go & + ;; "linux" | "darwin") - echo "Building $var" - GOOS="$(cut -d '/' -f 1 <<<$var)" GOARCH="$(cut -d '/' -f 2 <<<$var)" go build -o bin/"$file_name" -trimpath -ldflags="-s -w" ./cmd/jiotv_go - ;; + echo "Building $var" + GOOS="$(cut -d '/' -f 1 <<< $var)" GOARCH="$(cut -d '/' -f 2 <<< $var)" go build -o bin/"$file_name" -trimpath -ldflags="-s -w" ./cmd/jiotv_go & + ;; *) - echo "Skipping: $var" - ;; - esac + echo "Skipping: $var" + ;; + esac done + + # Wait for all background jobs to finish + wait - name: Release 📦 uses: softprops/action-gh-release@v1 @@ -126,4 +130,4 @@ jobs: generate_release_notes: true discussion_category_name: releases env: - GITHUB_TOKEN: ${{ secrets.PAT }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.PAT }}