improve build
All checks were successful
Build Quasar SPA and Go Backend for lightController / build-spa (push) Successful in 2m11s
Build Quasar SPA and Go Backend for lightController / build-backend (amd64, .exe, windows) (push) Successful in 4m11s
Build Quasar SPA and Go Backend for lightController / build-backend (amd64, , linux) (push) Successful in 4m22s
Build Quasar SPA and Go Backend for lightController / build-backend (arm, 6, , linux) (push) Successful in 3m55s
Build Quasar SPA and Go Backend for lightController / build-backend (arm64, , linux) (push) Successful in 3m51s

This commit is contained in:
Adrian Zürcher
2025-08-11 12:07:53 +02:00
parent 33f7775800
commit a648be3bcb

View File

@@ -6,29 +6,8 @@ on:
- '*'
jobs:
build:
strategy:
matrix:
include:
- os: windows-latest
goos: windows
arch: amd64
ext: .exe
- os: ubuntu-latest
goos: linux
arch: amd64
ext: ""
- os: ubuntu-latest
goos: linux
arch: arm64
ext: ""
- os: ubuntu-latest
goos: linux
arch: arm
arm_version: 6
ext: ""
runs-on: ${{ matrix.os }}
build-spa:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
@@ -38,7 +17,7 @@ jobs:
with:
node-version: '20'
- name: Install dependecies
- name: Install dependencies
run: npm install
- name: Install Quasar CLI
@@ -49,6 +28,41 @@ jobs:
- name: Build Quasar SPA
run: quasar build
- name: Upload SPA artifact
uses: actions/upload-artifact@v3
with:
name: quasar-dist
path: ./dist/spa
build-backend:
needs: build-spa
runs-on: ubuntu-latest
strategy:
matrix:
include:
- goos: windows
arch: amd64
ext: .exe
- goos: linux
arch: amd64
ext: ""
- goos: linux
arch: arm64
ext: ""
- goos: linux
arch: arm
arm_version: 6
ext: ""
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download SPA artifact
uses: actions/download-artifact@v3
with:
name: quasar-dist
path: ./dist/spa
- name: Ensure latest Go is installed in /data/go
run: |
export GOROOT=/data/go/go
@@ -59,10 +73,8 @@ jobs:
if [ ! -x "$GOROOT/bin/go" ]; then
echo "Go not found in $GOROOT, downloading latest stable..."
GO_VERSION=$(curl -s https://go.dev/VERSION?m=text | head -n1)
echo "Latest version is $GO_VERSION"
mkdir -p /data/go
curl -sSL "https://go.dev/dl/${GO_VERSION}.linux-amd64.tar.gz" -o /tmp/go.tar.gz
tar -C /data/go -xzf /tmp/go.tar.gz
@@ -83,7 +95,7 @@ jobs:
go mod tidy -v
go mod download
- name: Build go backend binary
- name: Build Go backend binary
working-directory: ./backend
run: |
export GOROOT=/data/go/go
@@ -92,17 +104,17 @@ jobs:
export GOMODCACHE=/data/gomodcache
mkdir -p $GOCACHE $GOMODCACHE
OUTPUT="../server-${{ matrix.goos }}-${{ matrix.goarch }}"
if [ "${{ matrix.goos }}" == "windows" ]; then
OUTPUT="${OUTPUT}.exe"
OUTPUT="../server-${{ matrix.goos }}-${{ matrix.arch }}${{ matrix.ext }}"
if [ "${{ matrix.arch }}" = "arm" ]; then
GOARM=${{ matrix.arm_version }}
fi
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -ldflags="-s -w" -trimpath -o "$OUTPUT" main.go
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.arch }} go build -ldflags="-s -w" -trimpath -o "$OUTPUT" main.go
- name: Upload build artifacts
- name: Upload combined package
uses: actions/upload-artifact@v3
with:
name: lightcontroller-${{ matrix.goos }}-${{ matrix.goarch }}
name: lightcontroller-${{ matrix.goos }}-${{ matrix.arch }}
path: |
./dist/spa
server-${{ matrix.goos }}-${{ matrix.goarch }}${{ (matrix.goos == 'windows' && '.exe') || '' }}
server-${{ matrix.goos }}-${{ matrix.arch }}${{ matrix.ext }}