Repository navigation
Expand file tree
/
Copy pathaction.yml
More file actions
59 lines (55 loc) · 2.09 KB
/
Copy pathaction.yml
File metadata and controls
59 lines (55 loc) · 2.09 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Setup Tecs
description: Install the Tecs CLI and cache its LÖVE runtime, putting `tecs` on PATH.
author: tecs-dev
branding:
icon: play
color: purple
inputs:
version:
description: 'Tecs version to install, e.g. "0.10.10". Defaults to the latest release.'
required: false
default: latest
runs:
using: composite
steps:
- name: Cache the LÖVE runtime
uses: actions/cache@v4
with:
path: ${{ runner.temp }}/tecs-cache
key: tecs-runtime-${{ runner.os }}-${{ inputs.version }}
- name: Install the Tecs CLI (Unix)
if: runner.os != 'Windows'
shell: bash
env:
VERSION: ${{ inputs.version }}
BIN_DIR: ${{ runner.temp }}/tecs-bin
run: |
set -euo pipefail
if [ "$VERSION" = "latest" ]; then
base="https://github.com/tecs-dev/tecs/releases/latest/download"
else
base="https://github.com/tecs-dev/tecs/releases/download/v${VERSION#v}"
fi
curl -fsSL "$base/install.sh" -o "$RUNNER_TEMP/install-tecs.sh"
TECS_RELEASE_BASE="$base" TECS_BIN_DIR="$BIN_DIR" bash "$RUNNER_TEMP/install-tecs.sh"
echo "$BIN_DIR" >> "$GITHUB_PATH"
echo "TECS_CACHE_DIR=$RUNNER_TEMP/tecs-cache" >> "$GITHUB_ENV"
- name: Install the Tecs CLI (Windows)
if: runner.os == 'Windows'
shell: pwsh
env:
VERSION: ${{ inputs.version }}
BIN_DIR: ${{ runner.temp }}\tecs-bin
run: |
$ErrorActionPreference = "Stop"
$base = if ($env:VERSION -eq "latest") {
"https://github.com/tecs-dev/tecs/releases/latest/download"
} else {
"https://github.com/tecs-dev/tecs/releases/download/v$($env:VERSION -replace '^v','')"
}
Invoke-WebRequest "$base/install.ps1" -OutFile "$env:RUNNER_TEMP\install-tecs.ps1"
$env:TECS_RELEASE_BASE = $base
$env:TECS_BIN_DIR = $env:BIN_DIR
& "$env:RUNNER_TEMP\install-tecs.ps1"
"$env:BIN_DIR" | Out-File -Append -Encoding utf8 $env:GITHUB_PATH
"TECS_CACHE_DIR=$($env:RUNNER_TEMP)\tecs-cache" | Out-File -Append -Encoding utf8 $env:GITHUB_ENV