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
|
||||
|
||||
@@ -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: 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 dependencies
|
||||
run: go mod download
|
||||
|
||||
- name: Build frontend
|
||||
run: |
|
||||
cd cmd/muyue-desktop/frontend
|
||||
npm ci
|
||||
npm run build
|
||||
|
||||
- name: Vet
|
||||
run: go vet ./...
|
||||
|
||||
@@ -45,7 +64,7 @@ jobs:
|
||||
echo "base=${BASE_VERSION}" >> $GITHUB_OUTPUT
|
||||
echo "Building stable release: ${VERSION}"
|
||||
|
||||
- name: Build all platforms
|
||||
- name: Build CLI (all platforms)
|
||||
run: |
|
||||
mkdir -p dist
|
||||
LDFLAGS="-s -w"
|
||||
@@ -56,6 +75,16 @@ 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 (all platforms)
|
||||
run: |
|
||||
LDFLAGS="-s -w"
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="$LDFLAGS" -o dist/muyue-desktop-linux-amd64 ./cmd/muyue-desktop/
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="$LDFLAGS" -o dist/muyue-desktop-linux-arm64 ./cmd/muyue-desktop/
|
||||
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="$LDFLAGS" -o dist/muyue-desktop-darwin-amd64 ./cmd/muyue-desktop/
|
||||
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags="$LDFLAGS" -o dist/muyue-desktop-darwin-arm64 ./cmd/muyue-desktop/
|
||||
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags="$LDFLAGS" -o dist/muyue-desktop-windows-amd64.exe ./cmd/muyue-desktop/
|
||||
CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build -ldflags="$LDFLAGS" -o dist/muyue-desktop-windows-arm64.exe ./cmd/muyue-desktop/
|
||||
|
||||
- name: Package archives
|
||||
run: |
|
||||
cd dist
|
||||
@@ -64,9 +93,15 @@ 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
|
||||
tar czf muyue-desktop-linux-arm64.tar.gz muyue-desktop-linux-arm64
|
||||
tar czf muyue-desktop-darwin-amd64.tar.gz muyue-desktop-darwin-amd64
|
||||
tar czf muyue-desktop-darwin-arm64.tar.gz muyue-desktop-darwin-arm64
|
||||
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
|
||||
zip muyue-desktop-windows-amd64.zip muyue-desktop-windows-amd64.exe
|
||||
zip muyue-desktop-windows-arm64.zip muyue-desktop-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 muyue-desktop-linux-arm64 muyue-desktop-darwin-amd64 muyue-desktop-darwin-arm64 muyue-desktop-windows-amd64.exe muyue-desktop-windows-arm64.exe
|
||||
|
||||
- name: Generate changelog
|
||||
id: changelog
|
||||
@@ -100,6 +135,17 @@ jobs:
|
||||
echo "| Windows x86_64 | [muyue-windows-amd64.zip](${DL_URL}/muyue-windows-amd64.zip) |"
|
||||
echo "| Windows ARM64 | [muyue-windows-arm64.zip](${DL_URL}/muyue-windows-arm64.zip) |"
|
||||
echo ""
|
||||
echo "### Downloads (Desktop)"
|
||||
echo ""
|
||||
echo "| Platform | File |"
|
||||
echo "|----------|------|"
|
||||
echo "| Linux x86_64 | [muyue-desktop-linux-amd64.tar.gz](${DL_URL}/muyue-desktop-linux-amd64.tar.gz) |"
|
||||
echo "| Linux ARM64 | [muyue-desktop-linux-arm64.tar.gz](${DL_URL}/muyue-desktop-linux-arm64.tar.gz) |"
|
||||
echo "| macOS Intel | [muyue-desktop-darwin-amd64.tar.gz](${DL_URL}/muyue-desktop-darwin-amd64.tar.gz) |"
|
||||
echo "| macOS Apple Silicon | [muyue-desktop-darwin-arm64.tar.gz](${DL_URL}/muyue-desktop-darwin-arm64.tar.gz) |"
|
||||
echo "| Windows x86_64 | [muyue-desktop-windows-amd64.zip](${DL_URL}/muyue-desktop-windows-amd64.zip) |"
|
||||
echo "| Windows ARM64 | [muyue-desktop-windows-arm64.zip](${DL_URL}/muyue-desktop-windows-arm64.zip) |"
|
||||
echo ""
|
||||
echo "### Install"
|
||||
echo ""
|
||||
echo "**Linux (x86_64)**"
|
||||
|
||||
@@ -15,6 +15,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:
|
||||
@@ -25,9 +30,23 @@ jobs:
|
||||
restore-keys: |
|
||||
${{ runner.os }}-go-
|
||||
|
||||
- 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 dependencies
|
||||
run: go mod download
|
||||
|
||||
- name: Build frontend
|
||||
run: |
|
||||
cd cmd/muyue-desktop/frontend
|
||||
npm ci
|
||||
npm run build
|
||||
|
||||
- name: Vet
|
||||
run: go vet ./...
|
||||
|
||||
@@ -37,4 +56,5 @@ jobs:
|
||||
- name: Build
|
||||
run: |
|
||||
go build -o muyue ./cmd/muyue/
|
||||
go build -o muyue-desktop ./cmd/muyue-desktop/
|
||||
./muyue version
|
||||
|
||||
Reference in New Issue
Block a user