Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b7e3fa435a | ||
![]() |
87d5d769c8 | ||
![]() |
510d2980ac | ||
![]() |
fb43c99920 | ||
![]() |
be1a06a759 | ||
![]() |
4951e2bb34 |
37
.github/workflows/build.yml
vendored
37
.github/workflows/build.yml
vendored
@@ -21,10 +21,10 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set ip Node.js
|
- name: Set ip Node.js
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '20'
|
node-version: '20'
|
||||||
|
|
||||||
@@ -36,29 +36,44 @@ jobs:
|
|||||||
npm install -g @quasar/cli quasar build
|
npm install -g @quasar/cli quasar build
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '1.24.0'
|
go-version: '1.24.0'
|
||||||
|
|
||||||
- name: Set up Git credentials for private modules
|
- name: Set up Git credentials for private modules
|
||||||
run: |
|
run: |
|
||||||
git config --global url."https://${{ secrets.GH_PAT }}@github.com/".insteadOf "https://github.com/"
|
git config --global url."https://oauth2:${{ secrets.GH_PAT }}@github.com".insteadOf "https://github.com"
|
||||||
echo "GOPRIVATE=github.com/tecamino/*" >> $GITHUB_ENV
|
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
|
||||||
|
|
||||||
- name: Build go backend binary
|
- name: Build go backend binary
|
||||||
working-directory: ./backend
|
working-directory: ./backend
|
||||||
run: |
|
run: |
|
||||||
mkdir -p build
|
mkdir -p build
|
||||||
if [ "${{ matrix.goos }}" == "windows" ]; then
|
if [ "${{ matrix.goos }}" == "windows" ]; then
|
||||||
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o build/tecamino-dbm-${{ matrix.goos }}-${{ matrix.goarch }}.exe main.go
|
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o build/server-${{ matrix.goos }}-${{ matrix.goarch }}.exe main.go
|
||||||
else
|
else
|
||||||
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o build/tecamino-dbm-${{ matrix.goos }}-${{ matrix.goarch }} main.go
|
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o build/server-${{ matrix.goos }}-${{ matrix.goarch }} main.go
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Upload build artifacts
|
- name: Upload build artifacts
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: binaries-${{ matrix.goos }}-${{ matrix.goarch }}
|
name: lightcontroller-${{ matrix.goos }}-${{ matrix.goarch }}
|
||||||
path: |
|
path: |
|
||||||
dist/spa
|
./dist/spa
|
||||||
backend/server
|
./backend/build/
|
||||||
|
Reference in New Issue
Block a user