From ab1ba21823587ecb510880738f2015e677792220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=97=E5=AD=90?= Date: Mon, 23 Oct 2023 10:34:28 +0800 Subject: [PATCH] =?UTF-8?q?feat(CI):=20=E6=B7=BB=E5=8A=A0=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E5=89=8D=E7=AB=AF=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/goreleaser.yml | 7 +++++++ .gitlab-ci.yml | 11 +++++++++++ 2 files changed, 18 insertions(+) diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml index 73811c1a..2f16541a 100644 --- a/.github/workflows/goreleaser.yml +++ b/.github/workflows/goreleaser.yml @@ -17,6 +17,13 @@ jobs: uses: actions/setup-go@v4 with: go-version: 'stable' + - name: Fetch Latest Frontend + run: | + apt install -y curl jq unzip zip + curl -s "https://jihulab.com/api/v4/projects/haozi-team%2Fpanel-frontend/releases" | jq -r '.[0].assets.links[] | select(.name | contains("arm64")) | .direct_asset_url' | xargs curl -L -o frontend.zip + rm -rf public + unzip frontend.zip + mv dist public - name: Run GoReleaser uses: goreleaser/goreleaser-action@v5 with: diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a5145566..f80947ee 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -52,8 +52,19 @@ build: - $OUTPUT_NAME expire_in: 3 days +fetch: + stage: build + script: + - apt install -y curl jq unzip zip + - curl -s https://api.github.com/repos/haozi-team/panel-frontend/releases/latest | jq -r ".assets[] | select(.name | contains(\"admin\")) | .browser_download_url" | xargs curl -L -o frontend.zip + - rm -rf public + - unzip frontend.zip + - mv dist public + release: stage: release + dependencies: + - build image: name: goreleaser/goreleaser entrypoint: ['']