-
Notifications
You must be signed in to change notification settings - Fork 774
Expand file tree
/
Copy pathaction.yml
More file actions
78 lines (67 loc) · 2.04 KB
/
action.yml
File metadata and controls
78 lines (67 loc) · 2.04 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: 'Install Mono'
description: 'Install Mono'
branding:
icon: package
color: blue
inputs:
arch:
description: Architecture to install for
required: true
runs:
using: "composite"
steps:
# Windows Cache
- name: Cache setup on Windows
if: runner.os == 'Windows'
run: |
mkdir -p .choco-cache
choco config set cacheLocation $(pwd)/.choco-cache
shell: bash
- name: Cache on Windows
if: runner.os == 'Windows'
uses: actions/cache@v5
with:
path: .choco-cache
key: mono-${{ runner.os }}-${{ inputs.arch }}
# macOS Cache
- name: Set Homebrew Cache Path
if: runner.os == 'macOS'
run: |
mkdir -p .brew-cache
echo "HOMEBREW_CACHE=$(pwd)/.brew-cache" >> $GITHUB_ENV
shell: bash
- name: Cache Homebrew on macOS
if: runner.os == 'macOS'
uses: actions/cache@v5
with:
path: .brew-cache
key: mono-brew-${{ runner.os }}-${{ inputs.arch }}
# ===================================
- name: Install on Linux
if: runner.os == 'Linux'
uses: awalsh128/cache-apt-pkgs-action@v1
with:
packages: mono-runtime-sgen
# ===================================
- name: Install on Windows (x86)
if: runner.os == 'Windows' && inputs.arch == 'x86'
run: choco install --x86 -y mono
shell: sh
- name: Install on Windows
if: runner.os == 'Windows' && inputs.arch != 'x86'
run: choco install -y mono
shell: sh
# ===================================
#
- name: Install on macOS (x86_64)
if: runner.os == 'macOS' && inputs.arch == 'x64'
run: |
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
arch -x86_64 /usr/local/bin/brew install --ignore-dependencies mono
shell: sh
- name: Install on macOS (arm64)
if: runner.os == 'macOS' && inputs.arch != 'x64'
run: |
brew update
brew install --ignore-dependencies mono
shell: sh