|
| 1 | +name: 'Install Mono' |
| 2 | +description: 'Install Mono' |
| 3 | +branding: |
| 4 | + icon: package |
| 5 | + color: blue |
| 6 | +inputs: |
| 7 | + arch: |
| 8 | + description: Architecture to install for |
| 9 | + required: true |
| 10 | +runs: |
| 11 | + using: "composite" |
| 12 | + 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 }} |
| 19 | + |
| 20 | + - name: Cache on Windows |
| 21 | + if: runner.os == 'Windows' |
| 22 | + uses: actions/cache@v5 |
| 23 | + with: |
| 24 | + path: ${{ env.TEMP }}\chocolatey |
| 25 | + key: mono-${{ runner.os }}-${{ inputs.arch }} |
| 26 | + |
| 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 }} |
| 40 | + |
| 41 | + # =================================== |
| 42 | + |
| 43 | + - name: Install on Linux |
| 44 | + 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 |
| 49 | + |
| 50 | + - name: Install on Windows (x86) |
| 51 | + if: runner.os == 'Windows' && inputs.arch == 'x86' |
| 52 | + run: choco install --x86 -y mono |
| 53 | + shell: sh |
| 54 | + |
| 55 | + - name: Install on Windows |
| 56 | + if: runner.os == 'Windows' && inputs.arch != 'x86' |
| 57 | + run: choco install -y mono |
| 58 | + shell: sh |
| 59 | + |
| 60 | + - name: Install on macOS (x86_64) |
| 61 | + if: runner.os == 'macOS' && inputs.arch == 'x64' |
| 62 | + run: | |
| 63 | + 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 |
| 65 | + shell: sh |
| 66 | + |
| 67 | + - name: Install on macOS (arm64) |
| 68 | + if: runner.os == 'macOS' && inputs.arch != 'x64' |
| 69 | + run: | |
| 70 | + brew update |
| 71 | + brew install mono |
| 72 | + shell: sh |
| 73 | + |
0 commit comments