From 2d0b21018fbf8c783def45fac18fbd627eda6e7c Mon Sep 17 00:00:00 2001 From: thun888 <2238342947@qq.com> Date: Sun, 24 Mar 2024 15:07:05 +0800 Subject: [PATCH] try fix Upload Release Assets (#26) * fix * [ImgBot] Optimize images *Total -- 435.32kb -> 276.76kb (36.42%) /otherfile/images/config.png -- 20.77kb -> 11.67kb (43.81%) /otherfile/images/history_index.png -- 414.56kb -> 265.09kb (36.05%) Signed-off-by: ImgBotApp * [Opt][Incomplete]Optimize history processing * [FIX][Build APP]Rclone * [ADD]Support Devices History Display * [OPT][FIX][BUILDAPP] * [OPT]Float process * [FIX]build app * fix Upload Release Assets * fix Upload Release Assets --------- Signed-off-by: ImgBotApp Co-authored-by: ImgBotApp --- .github/workflows/buildapp.yml | 30 ++++++++---------------------- main.go | 1 - 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/.github/workflows/buildapp.yml b/.github/workflows/buildapp.yml index ce1577b..69684d9 100644 --- a/.github/workflows/buildapp.yml +++ b/.github/workflows/buildapp.yml @@ -112,32 +112,18 @@ jobs: name: mirouter-ui-darwin path: ./build - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.TOKEN }} + - name: Upload Release Assets + uses: ncipollo/release-action@v1 + - name: Upload Release Assets + uses: ncipollo/release-action@v1 with: - tag_name: ${{ github.event.inputs.version }} - release_name: Release ${{ github.event.inputs.version }} + artifacts: "build/" + token: ${{ secrets.TOKEN }} + tag: ${{ github.event.inputs.version }} + name: Release ${{ github.event.inputs.version }} draft: true - prerelease: false - - - name: Upload Release Assets - run: | - for file in ./build/*; do - if [ -f "$file" ]; then - echo "Uploading $file" - curl \ - -H "Authorization: token ${{ secrets.TOKEN }}" \ - -H "Content-Type: $(file -b --mime-type $file)" \ - -F "file=@$file" \ - "${{ steps.create_release.outputs.upload_url }}=$(basename $file)" - fi - done # 安装 rclone - # dev版本不另外发release - name: Install rclone run: | cd ~ diff --git a/main.go b/main.go index 83366e4..dd795f6 100644 --- a/main.go +++ b/main.go @@ -428,7 +428,6 @@ func main() { } history := database.GetDeviceHistory(databasepath, deviceMac, fixupfloat_bool) - return c.JSON(http.StatusOK, map[string]interface{}{ "code": 0, "history": history,