From 1a2c2e35c75728809f825717d1a7fb3a7e8c7f7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=A5=E6=B5=B7?= Date: Tue, 11 Apr 2023 14:19:15 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E4=BC=98=E5=8C=96=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 9 +----- build.gh | 56 ----------------------------------- build.sh | 14 +++++++++ 3 files changed, 15 insertions(+), 64 deletions(-) delete mode 100644 build.gh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c8b9217b..9c88d4de 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,20 +13,13 @@ jobs: - name: Checkout uses: actions/checkout@v3 - ### - - name: Setup go uses: actions/setup-go@v3 with: go-version: 1.19 - - name: Setup node - uses: actions/setup-node@v3 - with: - node-version: 16 - - name: Build go binary - run: sh build.gh + run: sh build.sh - name: Create github release uses: softprops/action-gh-release@v1 diff --git a/build.gh b/build.gh deleted file mode 100644 index 95235a2a..00000000 --- a/build.gh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/sh -# - -set -e -set -o noglob - -########################################### - -if [ -n "$GITHUB_WORKSPACE" ]; then - WKDIR=`dirname $GITHUB_WORKSPACE` -else - WKDIR=$(dirname `dirname $0`) -fi - -# Create workspace - -mkdir -p $WKDIR -cd $WKDIR - -########################################### - -echo ">> Download source code" - -if [ ! -d tdp-cloud ]; then - git clone https://github.com/open-tdp/tdp-cloud.git -fi - -if [ ! -d tdp-cloud-ui ]; then - git clone https://github.com/open-tdp/tdp-cloud-ui.git -fi - -chmod +x $WKDIR/*/build.sh - -########################################### - -echo ">> Compile front-end components" - -cd $WKDIR/tdp-cloud-ui -npm i && ./build.sh - -cp -av $WKDIR/tdp-cloud-ui/build/* $WKDIR/tdp-cloud/front/ - -########################################### - -echo ">> Compile backend components" - -cd $WKDIR/tdp-cloud -go mod tidy && ./build.sh - -if [ -n "$WITH_UPX" ] && type upx >/dev/null 2>&1; then - upx `find build/ -type f` -fi - -for app in `ls build`; do - gzip build/$app -done diff --git a/build.sh b/build.sh index 9e2fa830..6bb313a6 100644 --- a/build.sh +++ b/build.sh @@ -17,6 +17,14 @@ build() { #################################################################### +releases_url=https://api.github.com/repos/open-tdp/tdp-cloud-ui/releases/latest +download_url=`wget -qO- $releases_url | grep releases/download | cut -f4 -d "\""` + +wget -O cloud-ui.tar.gz $download_url +tar xvf cloud-ui.tar.gz --strip-components 2 -C front + +#################################################################### + build android arm64 build darwin amd64 @@ -27,3 +35,9 @@ build linux arm64 build windows amd64 .exe build windows arm64 .exe + +#################################################################### + +for app in `ls build`; do + gzip build/$app +done