Skip to content

Commit c5113c3

Browse files
build: complete go.yml for buld artifacts in windows
1 parent 8316622 commit c5113c3

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

.github/workflows/go.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,21 @@ jobs:
2424
ext: ""
2525
steps:
2626
- uses: actions/checkout@v4
27-
2827
- uses: actions/setup-go@v4
2928
with:
3029
go-version: '1.23.0'
31-
3230
- name: Build artifact
31+
shell: pwsh
3332
env:
3433
GOOS: ${{ matrix.goos }}
3534
GOARCH: amd64
3635
run: |
37-
mkdir -p bin
38-
go build -v \
39-
-ldflags "-s -w" \
40-
-o bin/terminalapp_${{ matrix.goos }}_amd64${{ matrix.ext }} \
41-
./cmd/terminalapp/main
42-
36+
if ($Env:RUNNER_OS -eq 'Windows') {
37+
New-Item -ItemType Directory -Force -Path bin | Out-Null
38+
} else {
39+
mkdir -p bin
40+
}
41+
go build -v -ldflags "-s -w" -o "bin/terminalapp_${Env:GOOS}_amd64${{ matrix.ext }}" ./cmd/terminalapp/main
4342
- uses: actions/upload-artifact@v4
4443
with:
4544
name: terminalapp-${{ matrix.goos }}-amd64
@@ -53,7 +52,6 @@ jobs:
5352
- uses: actions/download-artifact@v4
5453
with:
5554
path: ./bin
56-
5755
- uses: softprops/action-gh-release@v1
5856
with:
5957
tag_name: ${{ github.ref_name }}

0 commit comments

Comments
 (0)