X Tutup
Skip to content

Commit 8e68a7c

Browse files
committed
Use custom mono install action
1 parent 56e3127 commit 8e68a7c

File tree

2 files changed

+35
-36
lines changed

2 files changed

+35
-36
lines changed

.github/actions/install-mono/action.yml

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,42 +10,45 @@ inputs:
1010
runs:
1111
using: "composite"
1212
steps:
13-
- name: Cache on Linux
14-
if: runner.os == 'Linux'
15-
uses: actions/cache@v5
16-
with:
17-
path: .apt
18-
key: mono-${{ runner.os }}-${{ inputs.arch }}
13+
# Windows Cache
14+
- name: Cache setup on Windows
15+
if: runner.os == 'Windows'
16+
run: |
17+
mkdir -p .choco-cache
18+
choco config set cacheLocation $(pwd)/.choco-cache
19+
shell: bash
1920

2021
- name: Cache on Windows
2122
if: runner.os == 'Windows'
2223
uses: actions/cache@v5
2324
with:
24-
path: ${{ env.TEMP }}\chocolatey
25+
path: .choco-cache
2526
key: mono-${{ runner.os }}-${{ inputs.arch }}
2627

27-
# - name: Cache on macOS (x86_64)
28-
# if: runner.os == 'Linux'
29-
# uses: actions/cache@v5
30-
# with:
31-
# path: .apt
32-
# key: mono-${{ runner.os }}-${{ inputs.arch }}
33-
#
34-
# - name: Cache on macOS (arm64)
35-
# if: runner.os == 'Linux'
36-
# uses: actions/cache@v5
37-
# with:
38-
# path: .apt
39-
# key: mono-${{ runner.os }}-${{ inputs.arch }}
28+
# macOS Cache
29+
- name: Set Homebrew Cache Path
30+
if: runner.os == 'macOS'
31+
run: |
32+
mkdir -p .brew-cache
33+
echo "HOMEBREW_CACHE=$(pwd)/.brew-cache" >> $GITHUB_ENV
34+
shell: bash
35+
36+
- name: Cache Homebrew on macOS
37+
if: runner.os == 'macOS'
38+
uses: actions/cache@v5
39+
with:
40+
path: .brew-cache
41+
key: mono-brew-${{ runner.os }}-${{ inputs.arch }}
4042

4143
# ===================================
4244

4345
- name: Install on Linux
4446
if: runner.os == 'Linux'
45-
run: |
46-
sudo apt-get -o Dir::Cache=".apt" update
47-
sudo apt-get -o Dir::Cache=".apt" install -y mono-runtime-sgen
48-
shell: sh
47+
uses: awalsh128/cache-apt-pkgs-action@v1
48+
with:
49+
packages: mono-runtime-sgen
50+
51+
# ===================================
4952

5053
- name: Install on Windows (x86)
5154
if: runner.os == 'Windows' && inputs.arch == 'x86'
@@ -57,17 +60,19 @@ runs:
5760
run: choco install -y mono
5861
shell: sh
5962

63+
# ===================================
64+
#
6065
- name: Install on macOS (x86_64)
6166
if: runner.os == 'macOS' && inputs.arch == 'x64'
6267
run: |
6368
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
64-
arch -x86_64 /usr/local/bin/brew install mono
69+
arch -x86_64 /usr/local/bin/brew install --ignore-dependencies mono
6570
shell: sh
6671

6772
- name: Install on macOS (arm64)
6873
if: runner.os == 'macOS' && inputs.arch != 'x64'
6974
run: |
7075
brew update
71-
brew install mono
76+
brew install --ignore-dependencies mono
7277
shell: sh
7378

.github/workflows/main.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,12 @@ jobs:
5656
- name: Checkout code
5757
uses: actions/checkout@v6
5858

59+
# Use main until support for architecture lands
5960
- name: Setup .NET
60-
uses: actions/setup-dotnet@v5
61+
uses: actions/setup-dotnet@main
6162
with:
62-
dotnet-version: '10.0.x'
63-
64-
- name: Setup upterm session
65-
uses: owenthereal/action-upterm@v1
66-
if: ${{ matrix.os.category == 'macos' }}
67-
with:
68-
## Shut down the server if unconnected after 5 minutes.
69-
limit-access-to-actor: true
70-
wait-timeout-minutes: 15
63+
dotnet-version: '10.0'
64+
architecture: ${{ matrix.os.platform }}
7165

7266
- name: Install Mono
7367
uses: ./.github/actions/install-mono

0 commit comments

Comments
 (0)
X Tutup