-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathaction.yml
73 lines (69 loc) · 2.42 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
65
66
67
68
69
70
71
72
73
---
name: "Setup Mint"
author: Yevhen Fabizhevskyi
description: "This action sets up a Mint programming language."
branding:
icon: feather
color: green
inputs:
version:
description: Mint version. Defaults to the latest version.
required: false
default: "latest"
force:
description: |
If "false" skips installation if mint is already installed. If "true"
installs mint 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 mint was installed or not.
value: "${{ steps.install-mint.outcome == 'success' }}"
runs:
using: "composite"
steps:
- name: Fail
if: (runner.os == 'Windows'
|| (runner.os == 'Linux' && startsWith(runner.arch, 'ARM')))
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: Download binary
if: ${{ steps.info.outputs.bin-installed == 'false' }}
id: download-binary
uses: robinraju/release-downloader@v1
with:
repository: "mint-lang/mint"
latest: "${{ inputs.version == 'latest' }}"
tag: "${{ inputs.version == 'latest' && '' || inputs.version }}"
fileName: "mint-*-${{ runner.os == 'Linux' && 'linux' || 'osx' }}-${{ startsWith(runner.arch, 'ARM') && 'arm64' || 'x86_64' }}"
out-file-path: "${{ steps.info.outputs.bin-dir }}"
token: "${{ inputs.github-token }}"
- name: Install mint
if: ${{ steps.info.outputs.bin-installed == 'false' }}
id: install-mint
run: |
tag_name="${{ steps.download-binary.outputs.tag_name }}"
mv "mint-${tag_name}-${{ runner.os == 'Linux' && 'linux' || 'osx' }}-${{ startsWith(runner.arch, 'ARM') && 'arm64' || 'x86_64' }}" mint
chmod +x mint
echo "$(pwd)" >> "$GITHUB_PATH"
shell: sh
working-directory: ${{ steps.info.outputs.bin-path }}
- name: Print version
run: mint version
shell: sh