-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
75 lines (71 loc) · 2.44 KB
/
Copy pathaction.yml
File metadata and controls
75 lines (71 loc) · 2.44 KB
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
65
66
67
68
69
70
71
72
73
74
75
---
name: "Setup Uiua"
author: Yevhen Fabizhevskyi
description: "This action installs Uiua language interpreter."
branding:
icon: terminal
color: gray-dark
inputs:
version:
description: Uiua version. Defaults to the latest version.
required: false
default: "latest"
force:
description: |
If "false" skips installation if Uiua is already installed. If "true"
installs Uiua 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 Uiua was installed or not.
value: "${{ steps.install-uiua.outcome == 'success' }}"
runs:
using: "composite"
steps:
- name: Validate inputs
env:
INPUT_VERSION: "${{ inputs.version }}"
INPUT_FORCE: "${{ inputs.force }}"
run: ./validate-inputs.sh "${INPUT_VERSION}" "${INPUT_FORCE}"
shell: sh
working-directory: ${{ github.action_path }}/src
- name: Collect info
id: info
env:
INPUT_FORCE: "${{ inputs.force }}"
run: ./collect-info.sh "${INPUT_FORCE}"
shell: sh
working-directory: ${{ github.action_path }}/src
- name: Download binary
if: ${{ steps.info.outputs.bin-installed == 'false' }}
id: download-binary
uses: robinraju/release-downloader@v1
with:
repository: "uiua-lang/uiua"
latest: "${{ inputs.version == 'latest' }}"
tag: "${{ case(inputs.version == 'latest', '', inputs.version) }}"
# yamllint disable-line rule:line-length
fileName: "uiua-bin-${{ case(startsWith(runner.arch, 'ARM'), 'aarch64', 'x86_64') }}-${{ case(runner.os == 'macOS', 'apple-darwin', runner.os == 'Windows', 'pc-windows-msvc', 'unknown-linux-gnu') }}.zip"
extract: "true"
out-file-path: "${{ steps.info.outputs.bin-dir }}"
token: "${{ inputs.github-token }}"
- name: Install Uiua
if: ${{ steps.info.outputs.bin-installed == 'false' }}
id: install-uiua
run: |
if [ "${RUNNER_OS}" != "Windows" ]; then
chmod +x uiua
fi
echo "$(pwd)" >> "$GITHUB_PATH"
shell: sh
working-directory: ${{ steps.info.outputs.bin-path }}
- name: Print version
run: uiua --version
shell: sh