add workingdir for go setup and conditional executable on backend

This commit is contained in:
Adrian Zürcher
2025-05-29 11:22:07 +02:00
parent 838ac4e7c3
commit c4fe532e88

View File

@@ -38,6 +38,7 @@ jobs:
run: quasar build run: quasar build
- name: Set up Go - name: Set up Go
working-directory: ./backend
uses: actions/setup-go@v5 uses: actions/setup-go@v5
with: with:
go-version: '1.24.0' go-version: '1.24.0'
@@ -65,11 +66,10 @@ jobs:
- name: Build go backend binary - name: Build go backend binary
working-directory: ./backend working-directory: ./backend
run: | run: |
mkdir -p build
if [ "${{ matrix.goos }}" == "windows" ]; then if [ "${{ matrix.goos }}" == "windows" ]; then
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o build/server-${{ matrix.goos }}-${{ matrix.goarch }}.exe main.go GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o ../server-${{ matrix.goos }}-${{ matrix.goarch }}.exe main.go
else else
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o build/server-${{ matrix.goos }}-${{ matrix.goarch }} main.go GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o ../server-${{ matrix.goos }}-${{ matrix.goarch }} main.go
fi fi
- name: Upload build artifacts - name: Upload build artifacts
@@ -78,4 +78,4 @@ jobs:
name: lightcontroller-${{ matrix.goos }}-${{ matrix.goarch }} name: lightcontroller-${{ matrix.goos }}-${{ matrix.goarch }}
path: | path: |
./dist/spa ./dist/spa
./backend/build/ server-${{ matrix.goos }}-${{ matrix.goarch }}${{ (matrix.goos == 'windows' && '.exe') || '' }}