-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
43 lines (43 loc) · 1.39 KB
/
action.yml
File metadata and controls
43 lines (43 loc) · 1.39 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
name: 'Install MLKit'
description: 'Installs the MLKit compiler'
inputs:
version:
description: 'Version to install (or "latest")'
required: false
default: 'latest'
runs:
using: "composite"
steps:
- id: setup-os
shell: bash
run: |
OS_NAME=$(echo "${{ runner.os }}" | tr '[:upper:]' '[:lower:]')
if [ "$OS_NAME" = "macos" ]; then
OS_NAME="darwin"
elif [ "$OS_NAME" != "linux" ]; then
echo "Error: Unsupported operating system '${{ runner.os }}'. Only Linux and macOS are supported."
exit 1
fi
echo "MLKIT_OS=$OS_NAME" >> "$GITHUB_ENV"
- id: fetch
uses: dsaltares/fetch-gh-release-asset@1.1.0
with:
repo: 'melsman/mlkit'
version: ${{ ((inputs.version == 'latest') && 'latest') || format('tags/v{0}', inputs.version) }}
regex: true
file: "mlkit-bin-dist-${{ env.MLKIT_OS }}.tgz"
target: 'mlkit-install-dir/'
- id: install
shell: bash
working-directory: 'mlkit-install-dir/'
run: |
tar xvf mlkit-bin-dist-${{ env.MLKIT_OS }}.tgz
mkdir -p "$HOME/.local/bin"
make -C mlkit-bin-dist-${{ env.MLKIT_OS }} install PREFIX=$HOME/.local
echo "SML_LIB=$HOME/.local/lib/mlkit" >> "$GITHUB_ENV"
- id: cleanup
shell: bash
run: rm -rf mlkit-install-dir
- id: report
shell: bash
run: mlkit --version