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