generated from fabasoad/typescript-setup-action
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yml
59 lines (55 loc) · 1.9 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
---
name: "Setup Kitten"
author: Yevhen Fabizhevskyi
description: "This action sets up a Kitten."
branding:
icon: terminal
color: gray-dark
inputs:
force:
description: |
If "false" skips installation if kitten is already installed. If "true"
installs kitten in any case. Defaults to "false".
required: false
default: "false"
outputs:
installed:
description: Whether kitten was installed or not.
value: "${{ steps.install-kitten.outcome == 'success' }}"
runs:
using: "composite"
steps:
- 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: Setup Stack
if: ${{ steps.info.outputs.bin-installed == 'false' && steps.info.outputs.stack-installed == 'false' }}
run: curl -sSL https://get.haskellstack.org/ | sh
shell: sh
- name: Download kitten
if: ${{ steps.info.outputs.bin-installed == 'false' }}
uses: actions/checkout@v4
with:
repository: "fabasoad/kitten"
ref: "7c46b5b48152bb75bc1482d0373d682b163bf3e5" # pragma: allowlist secret
# repository: "evincarofautumn/kitten"
# ref: "2bbc264d7f05c4a7d7b35d06773d1ab2f0623193" # pragma: allowlist secret
path: ${{ steps.info.outputs.bin-dir }}
- name: Install Kitten
if: ${{ steps.info.outputs.bin-installed == 'false' }}
id: install-kitten
run: |
stack setup --stack-yaml stack.yaml
stack build --stack-yaml stack.yaml
exe_path=$(find "$(pwd)/.stack-work/install" -name "kitten${{ runner.os == 'Windows' && '.exe' || '' }}")
bin_path=$(dirname "${exe_path}")
echo "${bin_path}" >> "$GITHUB_PATH"
shell: sh
working-directory: ${{ steps.info.outputs.bin-path }}
- name: Print version
run: kitten --version
shell: sh