generated from fabasoad/typescript-setup-action
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
64 lines (64 loc) · 2.31 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---
name: "Setup Umka"
author: Yevhen Fabizhevskyi
description: "This action sets up Umka scripting language interpreter."
branding:
icon: terminal
color: gray-dark
inputs:
version:
description: "Umka version."
required: false
default: "1.5"
runs:
using: "composite"
steps:
- name: Fail
if: ${{ runner.os == 'macOS' }}
run: echo "::error::${RUNNER_OS} ${RUNNER_ARCH} is not supported" && exit 1
shell: sh
- name: Collect info
if: ${{ runner.os != 'macOS' }}
id: info
env:
INPUT_VERSION: "${{ inputs.version }}"
run: |
if [ "${RUNNER_OS}" = "Linux" ]; then
bin_name=linux
exec_name=umka
else
bin_name=windows_mingw
exec_name=umka.exe
fi
echo "umka-installed=$(if command -v "${exec_name}" >/dev/null 2>&1; then echo true; else echo false; fi)" >> "$GITHUB_OUTPUT"
mkdir -p "${GITHUB_WORKSPACE}/umka"
echo "umka-path=${GITHUB_WORKSPACE}/umka" >> "$GITHUB_OUTPUT"
file_name="umka_${INPUT_VERSION}"
if [ "${INPUT_VERSION}" != "1.3" ] && [ "${INPUT_VERSION}" != "1.3.1" ] && [ "${INPUT_VERSION}" != "1.4" ] && [ "${INPUT_VERSION}" != "1.4.1" ] && [ "${INPUT_VERSION}" != "1.5" ]; then
file_name="${file_name}_x86-64"
fi
file_name="${file_name}_${bin_name}"
echo "file-name=${file_name}" >> "$GITHUB_OUTPUT"
shell: sh
- name: Download umka
if: ${{ steps.info.outputs.umka-installed == 'false' }}
uses: robinraju/release-downloader@v1.11
with:
repository: vtereshkov/umka-lang
latest: false
tag: v${{ inputs.version }}
fileName: ${{ steps.info.outputs.file-name }}.zip
tarBall: false
zipBall: false
out-file-path: umka
- name: Install umka
if: ${{ steps.info.outputs.umka-installed == 'false' }}
run: |
unzip "${{ steps.info.outputs.file-name }}.zip"
rm -f "${{ steps.info.outputs.file-name }}.zip"
if [ "${RUNNER_OS}" != "Windows" ]; then
chmod +x "${{ steps.info.outputs.umka-path }}/${{ steps.info.outputs.file-name }}/umka"
fi
echo "${{ steps.info.outputs.umka-path }}/${{ steps.info.outputs.file-name }}" >> "$GITHUB_PATH"
shell: sh
working-directory: ${{ steps.info.outputs.umka-path }}