File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,32 +42,27 @@ jobs:
4242
4343 build :
4444 name : Build
45+ runs-on : ubuntu-latest
4546 needs : [lint, test]
4647 strategy :
4748 matrix :
4849 include :
4950 - name : " Linux AMD64"
50- runs-on : ubuntu-latest
5151 goos : linux
5252 goarch : amd64
5353 - name : " Linux ARM64"
54- runs-on : ubuntu-latest
5554 goos : linux
5655 goarch : arm64
5756 - name : " macOS AMD64"
58- runs-on : macos-latest
5957 goos : darwin
6058 goarch : amd64
6159 - name : " macOS ARM64"
62- runs-on : macos-latest
6360 goos : darwin
6461 goarch : arm64
6562 - name : " Windows AMD64"
66- runs-on : windows-latest
6763 goos : windows
6864 goarch : amd64
6965 - name : " Windows ARM64"
70- runs-on : windows-latest
7166 goos : windows
7267 goarch : arm64
7368 steps :
@@ -87,10 +82,19 @@ jobs:
8782 GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} make build
8883 ls -la bin/
8984
85+ - name : Determine binary name
86+ id : binary-name
87+ run : |
88+ if [ "${{ matrix.goos }}" = "windows" ]; then
89+ echo "binary_name=torrbot.exe" >> $GITHUB_OUTPUT
90+ else
91+ echo "binary_name=torrbot" >> $GITHUB_OUTPUT
92+ fi
93+
9094 - name : Upload binary artifact
9195 uses : actions/upload-artifact@v4
9296 with :
9397 name : torrbot-${{ matrix.goos }}-${{ matrix.goarch }}
94- path : bin/torrbot
98+ path : bin/${{ steps.binary-name.outputs.binary_name }}
9599 if-no-files-found : error
96100 retention-days : 7
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ all: build
3636build :
3737 @mkdir -p $(BIN_DIR )
3838 CGO_ENABLED=$(CGO_ENABLED ) GOOS=$(GOOS ) GOARCH=$(GOARCH ) \
39- go build $(GOFLAGS ) -trimpath -ldflags=' $(LDFLAGS)' -o $(OUT ) .
39+ go build $(GOFLAGS ) -trimpath -ldflags=' $(LDFLAGS)' -o $(OUT )$( if $( filter windows, $( GOOS ) ) ,.exe) .
4040
4141run : build
4242 ./$(OUT )
You can’t perform that action at this time.
0 commit comments