-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
57 lines (57 loc) · 1.88 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
---
name: "Setup Jolie"
author: Yevhen Fabizhevskyi
description: "Set up a specific version of Jolie."
branding:
icon: terminal
color: gray-dark
inputs:
version:
description: "Jolie version."
required: false
default: "1.12.1"
runs:
using: "composite"
steps:
- name: Collect info
id: info
run: |
REALPATH_INSTALLED=$(if command -v realpath >/dev/null 2>&1; then echo true; else echo false; fi)
echo "REALPATH_INSTALLED=${REALPATH_INSTALLED}" >> $GITHUB_OUTPUT
JOLIE_INSTALLED=$(if command -v jolie >/dev/null 2>&1; then echo true; else echo false; fi)
echo "JOLIE_INSTALLED=${JOLIE_INSTALLED}" >> $GITHUB_OUTPUT
mkdir -p "${GITHUB_WORKSPACE}/jolie"
echo "JOLIE_PATH=${GITHUB_WORKSPACE}/jolie" >> $GITHUB_OUTPUT
shell: sh
- name: Install tools
if: ${{ steps.info.outputs.REALPATH_INSTALLED == 'false' && runner.os != 'Windows' }}
run: |
if [ "${RUNNER_OS}" = "Linux" ]; then
if [ -f "/etc/alpine-release" ]; then
apk add coreutils
else
apt-get install coreutils
fi
else
brew install coreutils
fi
shell: sh
- name: Download jolie
if: ${{ steps.info.outputs.JOLIE_INSTALLED == 'false' }}
uses: actions/checkout@v4
with:
repository: jolie/jolie
ref: v${{ inputs.version }}
fetch-depth: 1
path: jolie
- name: Install jolie
if: ${{ steps.info.outputs.JOLIE_INSTALLED == 'false' }}
run: |
mvn install -Dmaven.test.skip=true --quiet
bin_path="$(pwd)/bin_$(date '+%Y%m%d%H%M%S')"
mkdir -p "${bin_path}"
echo "${bin_path}" >> "$GITHUB_PATH"
./scripts/dev-setup.sh "${bin_path}"
echo "JOLIE_HOME=${bin_path}/jolie-dist" >> "$GITHUB_ENV"
shell: bash
working-directory: ${{ steps.info.outputs.JOLIE_PATH }}