Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
2e869d1d09 | ||
![]() |
c4fe532e88 |
18
.github/workflows/build.yml
vendored
18
.github/workflows/build.yml
vendored
@@ -41,6 +41,7 @@ jobs:
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.24.0'
|
||||
cache-dependency-path: backend/go.sum
|
||||
|
||||
- name: Set up Git credentials for private modules
|
||||
run: |
|
||||
@@ -48,16 +49,6 @@ jobs:
|
||||
env:
|
||||
GH_PAT_FOR_MODULES: ${{ secrets.GH_PAT }}
|
||||
|
||||
- name: Restore Go module cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/go/pkg/mod
|
||||
~/.cache/go-build # Optional, but good for build cache
|
||||
key: ${{ runner.os }}-${{ matrix.goos }}-${{ matrix.goarch }}-go-${{ hashFiles('backend/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-${{ matrix.goos }}-${{ matrix.goarch }}-go-
|
||||
|
||||
- name: Go Mod Tidy & Download
|
||||
working-directory: ./backend
|
||||
run: go mod tidy -v
|
||||
@@ -65,11 +56,10 @@ jobs:
|
||||
- name: Build go backend binary
|
||||
working-directory: ./backend
|
||||
run: |
|
||||
mkdir -p build
|
||||
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
|
||||
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
|
||||
|
||||
- name: Upload build artifacts
|
||||
@@ -78,4 +68,4 @@ jobs:
|
||||
name: lightcontroller-${{ matrix.goos }}-${{ matrix.goarch }}
|
||||
path: |
|
||||
./dist/spa
|
||||
./backend/build/
|
||||
server-${{ matrix.goos }}-${{ matrix.goarch }}${{ (matrix.goos == 'windows' && '.exe') || '' }}
|
||||
|
Reference in New Issue
Block a user