From 5dea08a3f23c8cb0aad5c85c7f574e43b30cf050 Mon Sep 17 00:00:00 2001 From: qwqcode <22412567+qwqcode@users.noreply.github.com> Date: Thu, 9 May 2024 13:24:50 +0800 Subject: [PATCH] feat(ci): include frontend dist files in release (#860) --- .goreleaser.yml | 2 ++ scripts/build-frontend.sh | 13 +++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index f11688c9..02c6379f 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -175,3 +175,5 @@ release: name: Artalk prerelease: auto draft: false + extra_files: + - glob: ./local/release_includes/* diff --git a/scripts/build-frontend.sh b/scripts/build-frontend.sh index 6ba921ff..35ace01c 100755 --- a/scripts/build-frontend.sh +++ b/scripts/build-frontend.sh @@ -18,8 +18,11 @@ fi pnpm install --frozen-lockfile pnpm build:all -## dist +## dist folders DIST_DIR="./public/dist" +SIDEBAR_DIR="./public/sidebar" + +## dist rm -rf ${DIST_DIR} && mkdir -p ${DIST_DIR} cp -r ./ui/artalk/dist/{Artalk.css,Artalk.js} ${DIST_DIR} cp -r ./ui/artalk/dist/{ArtalkLite.css,ArtalkLite.js} ${DIST_DIR} @@ -29,7 +32,6 @@ mkdir -p ${I18N_DIR} cp -r ./ui/artalk/dist/i18n/*.js ${I18N_DIR} ## sidebar -SIDEBAR_DIR="./public/sidebar" rm -rf ${SIDEBAR_DIR} && mkdir -p ${SIDEBAR_DIR} cp -r ./ui/artalk-sidebar/dist/* ${SIDEBAR_DIR} @@ -39,3 +41,10 @@ mkdir -p ${PLUGIN_DIR} pnpm build:auth cp -r ./ui/plugin-auth/dist/artalk-plugin-auth.js ${PLUGIN_DIR} + +## create tarball for release +mkdir -p ./local/artalk_ui +cp -r ${DIST_DIR} ${SIDEBAR_DIR} ./local/artalk_ui + +mkdir -p ./local/release_includes +tar -czf ./local/release_includes/artalk_ui.tar.gz -C ./local artalk_ui