@@ -7,9 +7,25 @@ branding:
7
7
color : green
8
8
inputs :
9
9
version :
10
- description : " Mint version"
10
+ description : Mint version. Defaults to the latest version.
11
11
required : false
12
- default : " 0.21.0"
12
+ default : " latest"
13
+ force :
14
+ description : |
15
+ If "false" skips installation if mint is already installed. If "true"
16
+ installs mint in any case. Defaults to "false".
17
+ required : false
18
+ default : " false"
19
+ github-token :
20
+ description : |
21
+ GitHub token that is used to send requests to GitHub API such as getting
22
+ latest release. Defaults to the token provided by GitHub Actions environment.
23
+ required : false
24
+ default : ${{ github.token }}
25
+ outputs :
26
+ installed :
27
+ description : Whether mint was installed or not.
28
+ value : " ${{ steps.install-mint.outcome == 'success' }}"
13
29
runs :
14
30
using : " composite"
15
31
steps :
@@ -20,29 +36,38 @@ runs:
20
36
echo "::error title=OS is not supported::${RUNNER_OS} ${RUNNER_ARCH} is not supported"
21
37
exit 1
22
38
shell : sh
39
+
23
40
- name : Collect info
24
41
id : info
25
42
env :
26
- INPUT_VERSION : " ${{ inputs.version }}"
27
- run : ./collect-info.sh "${INPUT_VERSION }"
43
+ INPUT_FORCE : " ${{ inputs.force }}"
44
+ run : ./collect-info.sh "${INPUT_FORCE }"
28
45
shell : sh
29
46
working-directory : " ${{ github.action_path }}/src"
30
- - name : Download
31
- if : ${{ steps.info.outputs.mint-installed == 'false' }}
47
+
48
+ - name : Download binary
49
+ if : ${{ steps.info.outputs.bin-installed == 'false' }}
50
+ id : download-binary
32
51
uses : robinraju/release-downloader@v1
33
52
with :
34
- repository : mint-lang/mint
35
- latest : false
36
- tag : ${{ inputs.version }}
37
- fileName : ${{ steps.info.outputs.mint-binary }}
38
- tarBall : false
39
- zipBall : false
40
- out-file-path : mint
41
- - name : Install
42
- if : ${{ steps.info.outputs.mint-installed == 'false' }}
53
+ repository : " mint-lang/mint"
54
+ latest : " ${{ inputs.version == 'latest' }}"
55
+ tag : " ${{ inputs.version == 'latest' && '' || inputs.version }}"
56
+ fileName : " mint-*-${{ runner.os == 'Linux' && 'linux' || 'osx' }}-${{ startsWith(runner.arch, 'ARM') && 'arm64' || 'x86_64' }}"
57
+ out-file-path : " ${{ steps.info.outputs.bin-dir }}"
58
+ token : " ${{ inputs.github-token }}"
59
+
60
+ - name : Install mint
61
+ if : ${{ steps.info.outputs.bin-installed == 'false' }}
62
+ id : install-mint
43
63
run : |
44
- mv "${{ steps.info.outputs.mint-binary }}" mint
64
+ tag_name="${{ steps.download-binary.outputs.tag_name }}"
65
+ mv "mint-${tag_name}-${{ runner.os == 'Linux' && 'linux' || 'osx' }}-${{ startsWith(runner.arch, 'ARM') && 'arm64' || 'x86_64' }}" mint
45
66
chmod +x mint
46
- echo "${{ steps.info.outputs.mint-path }}" >> "$GITHUB_PATH"
67
+ echo "$(pwd)" >> "$GITHUB_PATH"
68
+ shell : sh
69
+ working-directory : ${{ steps.info.outputs.bin-path }}
70
+
71
+ - name : Print version
72
+ run : mint version
47
73
shell : sh
48
- working-directory : ${{ steps.info.outputs.mint-path }}
0 commit comments