-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
73 lines (69 loc) · 2.3 KB
/
Copy pathaction.yml
File metadata and controls
73 lines (69 loc) · 2.3 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
---
name: "Setup Ciao"
author: Yevhen Fabizhevskyi
description: "This action installs Ciao CLI tool."
branding:
icon: terminal
color: gray-dark
inputs:
version:
description: Ciao version. Defaults to the latest version.
required: false
default: "latest"
force:
description: |
If "false" skips installation if ciao is already installed. If "true"
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 getting
latest release. Defaults to the token provided by GitHub Actions environment.
required: false
default: ${{ github.token }}
outputs:
installed:
description: Whether ciao was installed or not.
value: "${{ steps.install-ciao.outcome == 'success' }}"
runs:
using: "composite"
steps:
- name: Fail
if: ${{ runner.os == 'Windows' }}
run: |
echo "::error title=OS is not supported::${RUNNER_OS} ${RUNNER_ARCH} is not supported"
exit 1
shell: sh
- 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: Get latest release
if: ${{ steps.info.outputs.bin-installed == 'false' && inputs.version == 'latest' }}
id: latest-release
env:
INPUT_GITHUB_TOKEN: "${{ inputs.github-token }}"
run: ./get-latest-release.sh "ciao-lang/ciao" "${INPUT_GITHUB_TOKEN}"
shell: sh
working-directory: "${{ github.action_path }}/src"
- name: Download ciao
if: ${{ steps.info.outputs.bin-installed == 'false' }}
uses: actions/checkout@v7
with:
repository: "ciao-lang/ciao"
ref: "${{ format('v{0}', case(inputs.version == 'latest', steps.latest-release.outputs.version, inputs.version)) }}"
fetch-depth: 1
path: "${{ steps.info.outputs.bin-dir }}"
persist-credentials: "false"
- name: Install Ciao
if: ${{ steps.info.outputs.bin-installed == 'false' }}
id: install-ciao
run: |
./ciao-boot.sh local-install
echo "$(pwd)/build/bin" >> "$GITHUB_PATH"
shell: sh
working-directory: "${{ steps.info.outputs.bin-path }}"