Skip to content

Commit

Permalink
Fix tests 9
Browse files Browse the repository at this point in the history
  • Loading branch information
fabasoad committed Dec 30, 2024
1 parent 89e0e85 commit cee75e3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 33 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ None.
# (Optional) If "false" skips installation if ciao is already installed. If
# "true" installs ciao in any case. Defaults to "false".
force: "false"
# (Optional) GitHub token that is used to send requests to GitHub API such
# as downloading asset. Defaults to the token provided by GitHub Actions
# environment.
github-token: "${{ github.token }}"
```
## Outputs
Expand Down
36 changes: 7 additions & 29 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ inputs:
installs ciao in any case. Defaults to "false".
required: false
default: "false"
github-token:
description: |
GitHub token that is used to send requests to GitHub API such as downloading
asset. Defaults to the token provided by GitHub Actions environment.
required: false
default: ${{ github.token }}
outputs:
installed:
description: Whether umka was installed or not.
Expand All @@ -31,44 +25,28 @@ runs:
steps:
- name: Collect info
id: info
env:
INPUT_FORCE: "${{ inputs.force }}"
run: |
if [ "${INPUT_FORCE}" = "false" ] && command -v ciao >/dev/null 2>&1; then
bin_installed="true"
else
bin_installed="false"
fi
echo "bin-installed=${bin_installed}" >> "$GITHUB_OUTPUT"
bin_dir="ciao_$(date +%s)"
echo "bin-dir=${bin_dir}" >> "$GITHUB_OUTPUT"
bin_path="${GITHUB_WORKSPACE}/${bin_dir}"
mkdir -p "${bin_path}"
echo "bin-path=${bin_path}" >> "$GITHUB_OUTPUT"
target_path="${RUNNER_TEMP}/${bin_dir}"
mkdir -p "${target_path}"
echo "target-path=${target_path}" >> "$GITHUB_OUTPUT"
shell: sh
- name: Download binary
if: ${{ steps.info.outputs.bin-installed == 'false' }}
id: download-binary
uses: robinraju/release-downloader@v1
with:
repository: "ciao-lang/ciao"
latest: "${{ inputs.version == 'latest' }}"
tag: "${{ inputs.version != 'latest' && format('v{0}', inputs.version) || '' }}"
fileName: "ciao-*-${{ runner.os == 'Linux' && 'LINUXx86_64' || (runner.os == 'Windows' && 'Win32x86_64' || 'DARWINaarch64') }}.tar.gz"
extract: "true"
out-file-path: "${{ steps.info.outputs.bin-dir }}"
token: "${{ inputs.github-token }}"
- name: Install Ciao
if: ${{ steps.info.outputs.bin-installed == 'false' }}
id: install-ciao
env:
INPUT_VERSION: "${{ inputs.version }}"
run: |
curl https://ciao-lang.org/boot -sSfL | sh -s -- --prebuilt-bin local-install --release=${INPUT_VERSION}
for dir in $HOME/.ciaoroot/*/; do
if [ -d "${dir}" ]; then
echo "${dir}" >> "$GITHUB_PATH"
fi
done
# tag_name="${{ steps.download-binary.outputs.tag_name }}"
# version="${tag_name#v}"
# version="${version%%-*}"
Expand Down

0 comments on commit cee75e3

Please sign in to comment.