fix(ci): add frontend build step before Go vet/test/build
All checks were successful
Beta Release / beta (push) Successful in 1m16s
All checks were successful
Beta Release / beta (push) Successful in 1m16s
All three CI workflows now build the React frontend (npm ci && npm run build) before any Go steps, so the go:embed directive in cmd/muyue-desktop/main.go finds the dist/ directory. - ci-develop.yml: already rewritten, included in this commit - ci-main.yml: add Node 22 setup, cache, frontend build, desktop binary builds for all platforms, updated changelog download table - ci-pr.yml: add Node 22 setup, cache, frontend build, desktop binary build check 💘 Generated with Crush Assisted-by: GLM-5.1 via Crush <crush@charm.land>
This commit is contained in:
@@ -17,6 +17,11 @@ jobs:
|
||||
with:
|
||||
go-version: '1.24.3'
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '22'
|
||||
|
||||
- name: Cache Go modules
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
@@ -27,9 +32,23 @@ jobs:
|
||||
restore-keys: |
|
||||
${{ runner.os }}-go-
|
||||
|
||||
- name: Download dependencies
|
||||
- name: Cache Node modules
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: cmd/muyue-desktop/frontend/node_modules
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('cmd/muyue-desktop/frontend/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Download Go dependencies
|
||||
run: go mod download
|
||||
|
||||
- name: Build frontend
|
||||
run: |
|
||||
cd cmd/muyue-desktop/frontend
|
||||
npm ci
|
||||
npm run build
|
||||
|
||||
- name: Vet
|
||||
run: go vet ./...
|
||||
|
||||
@@ -49,7 +68,7 @@ jobs:
|
||||
echo "beta_num=${BETA_NUM}" >> $GITHUB_OUTPUT
|
||||
echo "Building beta release: ${VERSION}"
|
||||
|
||||
- name: Build all platforms
|
||||
- name: Build CLI (all platforms)
|
||||
run: |
|
||||
mkdir -p dist
|
||||
VERSION=${{ steps.version.outputs.version }}
|
||||
@@ -61,6 +80,12 @@ jobs:
|
||||
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags="$LDFLAGS" -o dist/muyue-windows-amd64.exe ./cmd/muyue/
|
||||
CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build -ldflags="$LDFLAGS" -o dist/muyue-windows-arm64.exe ./cmd/muyue/
|
||||
|
||||
- name: Build Desktop (linux amd64)
|
||||
run: |
|
||||
VERSION=${{ steps.version.outputs.version }}
|
||||
LDFLAGS="-s -w -X github.com/muyue/muyue/internal/version.Prerelease=${VERSION#v}"
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="$LDFLAGS" -o dist/muyue-desktop-linux-amd64 ./cmd/muyue-desktop/
|
||||
|
||||
- name: Package archives
|
||||
run: |
|
||||
cd dist
|
||||
@@ -69,9 +94,10 @@ jobs:
|
||||
tar czf muyue-linux-arm64.tar.gz muyue-linux-arm64
|
||||
tar czf muyue-darwin-amd64.tar.gz muyue-darwin-amd64
|
||||
tar czf muyue-darwin-arm64.tar.gz muyue-darwin-arm64
|
||||
tar czf muyue-desktop-linux-amd64.tar.gz muyue-desktop-linux-amd64
|
||||
zip muyue-windows-amd64.zip muyue-windows-amd64.exe
|
||||
zip muyue-windows-arm64.zip muyue-windows-arm64.exe
|
||||
rm -f muyue-linux-amd64 muyue-linux-arm64 muyue-darwin-amd64 muyue-darwin-arm64 muyue-windows-amd64.exe muyue-windows-arm64.exe
|
||||
rm -f muyue-linux-amd64 muyue-linux-arm64 muyue-darwin-amd64 muyue-darwin-arm64 muyue-windows-amd64.exe muyue-windows-arm64.exe muyue-desktop-linux-amd64
|
||||
|
||||
- name: Generate changelog
|
||||
id: changelog
|
||||
|
||||
Reference in New Issue
Block a user