diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index d7a0141..0000000 --- a/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -# -# Copyright 2024 tofuutils authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -FROM tofuutils/tenv:4.9 -LABEL maintainer="TofuUtils Core Team" - -COPY src/tenv-action.sh /tenv-action.sh -RUN chmod +x /tenv-action.sh -ENTRYPOINT ["/bin/sh", "/tenv-action.sh"] diff --git a/action.yml b/action.yml index 08e3615..6f61858 100644 --- a/action.yml +++ b/action.yml @@ -13,7 +13,6 @@ inputs: tool_version: description: "" required: false - default: "latest" github_token: description: "API token for GitHub to increase the rate limit." default: "" @@ -31,5 +30,17 @@ outputs: value: "126" runs: - using: "docker" - image: "Dockerfile" + using: "composite" + steps: + - uses: OJFord/setup-tenv@issues/16 + with: + github_token: "${{inputs.github_token}}" + tenv_wrapper: "false" + + - run: "tenv ${{inputs.tool_name}} install ${{inputs.tool_version}}" + if: ${{inputs.tool_version != ''}} + shell: "bash" + + - run: "tenv ${{inputs.tool_name}} detect --install" + if: ${{inputs.tool_version == ''}} + shell: "bash" diff --git a/src/tenv-action.sh b/src/tenv-action.sh deleted file mode 100644 index 5b16548..0000000 --- a/src/tenv-action.sh +++ /dev/null @@ -1,25 +0,0 @@ -# -# Copyright 2024 tofuutils authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -#!/bin/bash -set -e - -TOOL_NAME="${INPUT_TOOL_NAME}" -TOOL_VERSION="${INPUT_TOOL_VERSION}" -GITHUB_TOKEN="${INPUT_GITHUB_TOKEN}" - -export TENV_ROOT=$GITHUB_WORKSPACE/.tenv -mkdir -p ${TENV_ROOT} -tenv ${TOOL_NAME} install ${TOOL_VERSION}