From 7eb9f7ce4a852895e2853a75ea54fbac0af7fb61 Mon Sep 17 00:00:00 2001 From: leafus Date: Sun, 29 Sep 2024 05:07:22 +0200 Subject: [PATCH] Update .gitea/workflows/build.yaml --- .gitea/workflows/build.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 1107b0e..4ef7e8e 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -18,12 +18,24 @@ jobs: with: go-version: '1.23.1' + - name: Check if main.go was modified + id: check_main_go + run: | + git fetch origin main + if git diff --name-only HEAD origin/main | grep -q 'main.go'; then + echo "main_go_modified=true" >> $GITHUB_ENV + else + echo "main_go_modified=false" >> $GITHUB_ENV + fi + - name: Build Go binary for Linux + if: env.main_go_modified == 'true' run: | go mod tidy go build -o s3-client_linux.x86_64 - name: Build Go binary for Windows + if: env.main_go_modified == 'true' run: | GOOS=windows GOARCH=amd64 go build -o s3-client_windows.x86_64.exe