Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 更新基础镜像 #11

Merged
merged 1 commit into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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 /
Expand Down
21 changes: 11 additions & 10 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down