From 7c3e11a0c04435f36a445fdfe158a6860446ee5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=97=E5=AD=90?= Date: Sun, 29 Dec 2024 02:18:35 +0800 Subject: [PATCH] workflow: fix goreleaser --- .github/workflows/goreleaser.yml | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml index c016c8624b..8a0b8dfc38 100644 --- a/.github/workflows/goreleaser.yml +++ b/.github/workflows/goreleaser.yml @@ -18,19 +18,28 @@ jobs: with: cache: true go-version: 'stable' - - name: Wait for frontend build - uses: lewagon/wait-on-check-action@v1.3.4 + - name: Setup pnpm + uses: pnpm/action-setup@v4 with: - ref: ${{ github.event.pull_request.head.sha || github.sha }} - check-name: 'build (frontend)' - repo-token: ${{ secrets.GITHUB_TOKEN }} - - name: Download frontend - uses: dawidd6/action-download-artifact@v7 + version: latest + run_install: true + package_json_file: web/package.json + - name: Setup Node.js + uses: actions/setup-node@v4 with: - workflow: frontend.yml - name: frontend - path: internal/embed/frontend - check_artifacts: true + node-version: 22 + cache: 'pnpm' + cache-dependency-path: web/pnpm-lock.yaml + - name: Build frontend + working-directory: web + # We need to run the dev server first to generate the auto-imports files + run: | + cp .env.production .env + cp settings/proxy-config.example.ts settings/proxy-config.ts + pnpm dev & + sleep 5 + kill %1 + pnpm build - name: Set environment variables run: | echo "GOVERSION=$(go version | cut -d' ' -f3)" >> $GITHUB_ENV