From 4f545136ecedfcf690b6dbd9065dde7969b01671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Thu, 4 Jul 2024 10:49:19 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E5=9F=BA=E7=A1=80?= =?UTF-8?q?=E9=95=9C=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 2 +- build.sh | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 77e5639..52e7085 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Container image that runs your code -FROM centos:7 +FROM debian:trixie-slim # Copies your code file from your action repository to the filesystem path `/` of the container COPY *.sh / diff --git a/build.sh b/build.sh index c3c223a..8779416 100755 --- a/build.sh +++ b/build.sh @@ -5,27 +5,28 @@ OS=${INPUT_OS-''} ARCH=${INPUT_ARCH-''} RELEASE_TAG=$(basename "${GITHUB_REF:-'master'}") export VERSION=${RELEASE_TAG:-"master"} -#INPUT_UPLOAD_URL='https://uploads.github.com/repos/ibuler/koko/releases/27862783/assets' -if [[ -n "${INPUT_UPLOAD_URL=''}" ]];then - RELEASE_ASSETS_UPLOAD_URL=${INPUT_UPLOAD_URL} -else - RELEASE_ASSETS_UPLOAD_URL=$(jq -r .release.upload_url < "${GITHUB_EVENT_PATH}") -fi -RELEASE_ASSETS_UPLOAD_URL=${RELEASE_ASSETS_UPLOAD_URL%\{?name,label\}} -#INPUT_GITHUB_TOKEN= function add_pkg() { pkg=$1 command -v apk && apk add ${pkg} && return 0 - command -v yum && yum install ${pkg} && return 0 - command -v apt && apt get ${pkg} && return 0 + command -v yum && yum makecache fast && yum install -y ${pkg} && return 0 + command -v apt && apt-get update && apt-get install -y ${pkg} && return 0 } if [[ $(uname) != 'Darwin' ]];then command -v bash || add_pkg bash command -v curl || add_pkg curl + command -v jq || add_pkg jq fi +#INPUT_UPLOAD_URL='https://uploads.github.com/repos/ibuler/koko/releases/27862783/assets' +if [[ -n "${INPUT_UPLOAD_URL=''}" ]];then + RELEASE_ASSETS_UPLOAD_URL=${INPUT_UPLOAD_URL} +else + RELEASE_ASSETS_UPLOAD_URL=$(jq -r .release.upload_url < "${GITHUB_EVENT_PATH}") +fi +RELEASE_ASSETS_UPLOAD_URL=${RELEASE_ASSETS_UPLOAD_URL%\{?name,label\}} +#INPUT_GITHUB_TOKEN= function get_md5() { file=$1