From fbdb55dd636bd611f064e61f908b3c05a73c0d8c Mon Sep 17 00:00:00 2001 From: yuudi Date: Sun, 27 Dec 2020 09:33:56 +0800 Subject: [PATCH] update scripts --- .github/workflows/gocqhttp-build.yml | 6 ++++-- gocqhttp/fetch-latest.py | 7 ------- hoshinobot/Dockerfile | 4 ++-- 3 files changed, 6 insertions(+), 11 deletions(-) delete mode 100644 gocqhttp/fetch-latest.py diff --git a/.github/workflows/gocqhttp-build.yml b/.github/workflows/gocqhttp-build.yml index ca00715..fdcb530 100644 --- a/.github/workflows/gocqhttp-build.yml +++ b/.github/workflows/gocqhttp-build.yml @@ -11,11 +11,13 @@ jobs: - name: Fecth latest gocqhttp version id: fetch_version - run: python3 gocqhttp/fetch-latest.py + run: | + tagname="$(curl -sL https://api.github.com/repos/Mrs4s/go-cqhttp/releases | jq -r '.[0].tag_name')" + echo ::set-output name=version::${tagname:1} - name: Download latest gocqhttp run: | - wget https://github.com/Mrs4s/go-cqhttp/releases/download/v${{ steps.fetch_version.outputs.version }}/go-cqhttp-v${{ steps.fetch_version.outputs.version }}-linux-amd64.tar.gz + wget -q https://github.com/Mrs4s/go-cqhttp/releases/download/v${{ steps.fetch_version.outputs.version }}/go-cqhttp-v${{ steps.fetch_version.outputs.version }}-linux-amd64.tar.gz tar zxf go-cqhttp-v${{ steps.fetch_version.outputs.version }}-linux-amd64.tar.gz - name: Build go-cqhttp image diff --git a/gocqhttp/fetch-latest.py b/gocqhttp/fetch-latest.py deleted file mode 100644 index b37844b..0000000 --- a/gocqhttp/fetch-latest.py +++ /dev/null @@ -1,7 +0,0 @@ -import json -import urllib.request - -url = 'https://api.github.com/repos/Mrs4s/go-cqhttp/releases' -resp = urllib.request.urlopen(url).read().decode('utf-8') -version = json.loads(resp)[0]['tag_name'][1:] -print(f'::set-output name=version::{version}') diff --git a/hoshinobot/Dockerfile b/hoshinobot/Dockerfile index abcd84d..81c9a0c 100644 --- a/hoshinobot/Dockerfile +++ b/hoshinobot/Dockerfile @@ -1,9 +1,9 @@ FROM alpine/git AS downloader RUN git clone https://github.com/Ice-Cirno/HoshinoBot.git /tmp/HoshinoBot --depth=1 \ - && wget https://download.yobot.win/hoshinobot/res.tar.gz -O res.tar.gz \ + && wget -q https://disk.yobot.xyz/auto/hoshinobot/res.tar.gz -O res.tar.gz \ && tar zxf res.tar.gz -C /tmp \ - && wget https://download.yobot.win/hoshinobot/ttc.tar.gz -O ttc.tar.gz \ + && wget -q https://disk.yobot.xyz/auto/hoshinobot/ttc.tar.gz -O ttc.tar.gz \ && mkdir /tmp/chinese \ && tar zxf ttc.tar.gz -C /tmp/chinese