From 495d24fecaaadc1578488903fc03d7e56dade44a Mon Sep 17 00:00:00 2001 From: minglipro Date: Wed, 18 Jun 2025 22:18:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20install.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/action.yaml | 7 ------- install.sh | 29 ++++++++++++++++++++--------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/.gitea/workflows/action.yaml b/.gitea/workflows/action.yaml index 6415300..827aceb 100644 --- a/.gitea/workflows/action.yaml +++ b/.gitea/workflows/action.yaml @@ -33,11 +33,4 @@ jobs: VERSIONS=$(echo "$VERSIONS" | tr -d '\r') FILENAME="${GROUPSID}-${VERSIONS}.jar" java -jar build/libs/${FILENAME} -s "${{gitea.server_url}}" -o "${{gitea.repository_owner}}" -r ${{gitea.event.repository.name}} -t "${{gitea.token}}" -ti "Auto releases ${{gitea.sha}} ${VERSIONS}" -b "# Auto releases wtih ${{gitea.event.head_commit.message}} - [${{gitea.sha}}](${{gitea.event.head_commit.url}})" -tn "Auto-Releases-${VERSIONS}-${{gitea.sha}}" -a "build/libs" - TestEnv: - runs-on: ubuntu-latest - steps: - - name: TestPython2 - run: | - python -v - python --version 2>&1 | grep -q "Python 2" && echo "Python 2 ready" || echo "Python 2 not found" \ No newline at end of file diff --git a/install.sh b/install.sh index a130f3b..5c25e2f 100644 --- a/install.sh +++ b/install.sh @@ -1,14 +1,25 @@ -curl -o releases.json https://git.mingliqiye.com/api/v1/repos/Actions/com.mingliqiye.gitea.releases/releases -FILENAME=$(jq -r .[0].assets[0].name releases.json) -DOWNLOADURL=$(jq -r .[0].assets[0].browser_download_url releases.json) +curl -o releases.json https://git.mingliqiye.com/api/v1/repos/Actions/com.mingliqiye.gitea.releases/releases -echo fileName:$FILENAME -echo BrowserDownloadUrl:$DOWNLOADURL -echo Downloading ... $FILENAME +FILENAME=$(python3 -c " +import json; +with open('releases.json') as f: + data = json.load(f) +print(data[0]['assets'][0]['name']) +") -curl -O $DOWNLOADURL +DOWNLOADURL=$(python3 -c " +import json; +with open('releases.json') as f: + data = json.load(f) +print(data[0]['assets'][0]['browser_download_url']) +") -mv $FILENAME com.mingliqiye.gitea.releases.jar +echo "fileName:$FILENAME" +echo "BrowserDownloadUrl:$DOWNLOADURL" +echo "Downloading ... $FILENAME" +curl -O "$DOWNLOADURL" +mv "$FILENAME" com.mingliqiye.gitea.releases.jar rm releases.json -rm install.sh \ No newline at end of file +ls +echo com.mingliqiye.gitea.releases.jar Downloaded