-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
38 lines (36 loc) · 1.32 KB
/
action.yml
File metadata and controls
38 lines (36 loc) · 1.32 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
name: 'Setup Chemical'
description: 'Install the Chemical compiler and add it to the PATH'
author: 'Chemical Language Foundation'
inputs:
version:
description: 'Version of Chemical to install (e.g., v0.0.30, or "latest")'
required: false
default: 'latest'
variant:
description: 'Variant of Chemical to install (e.g., lsp, tcc, or leave empty)'
required: false
default: ''
runs:
using: 'composite'
steps:
- name: Download and Install Chemical
shell: bash
env:
VERSION: ${{ inputs.version }}
VARIANT: ${{ inputs.variant }}
run: |
curl -sSL https://raw.githubusercontent.com/chemicallang/chemical/main/scripts/download.sh | bash
# Robust path detection for both Linux and Windows runners
if [ -d "/opt/chemical" ]; then
echo "/opt/chemical" >> $GITHUB_PATH
echo "CHEMICAL_HOME=/opt/chemical" >> $GITHUB_ENV
elif [ -d "$USERPROFILE/.chemical" ]; then
echo "$USERPROFILE/.chemical" >> $GITHUB_PATH
echo "CHEMICAL_HOME=$USERPROFILE/.chemical" >> $GITHUB_ENV
elif [ -d "$HOME/.chemical" ]; then
echo "$HOME/.chemical" >> $GITHUB_PATH
echo "CHEMICAL_HOME=$HOME/.chemical" >> $GITHUB_ENV
fi
branding:
icon: 'cpu'
color: 'blue'