Skip to content

Commit 6489e31

Browse files
committed
some ci fix
1 parent c585035 commit 6489e31

3 files changed

Lines changed: 12 additions & 8 deletions

File tree

.github/workflows/build.yaml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff 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

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ all: build
3636
build:
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

4141
run: build
4242
./$(OUT)

bin/torrbot

-10.1 MB
Binary file not shown.

0 commit comments

Comments
 (0)