| 1 | name: 'Install bootstrap dependencies' |
| 2 | description: 'Install dependencies to bootstrap MLton' |
| 3 | inputs: |
| 4 | runner: |
| 5 | required: true |
| 6 | install-llvm: |
| 7 | required: true |
| 8 | runs: |
| 9 | using: "composite" |
| 10 | steps: |
| 11 | - name: Install bootstrap dependencies (ubuntu (amd64)) |
| 12 | if: ${{ contains(fromJSON('["ubuntu-20.04", "ubuntu-22.04", "ubuntu-24.04"]'), inputs.runner) }} |
| 13 | shell: 'bash' |
| 14 | run: | |
| 15 | # Install dependencies (ubuntu (amd64)) |
| 16 | sudo apt-get update |
| 17 | sudo apt-get install libgmp-dev |
| 18 | if [[ "${{ inputs.install-llvm }}" == "true" ]]; then sudo apt-get install llvm; fi |
| 19 | mkdir boot && cd boot |
| 20 | curl -sOL https://github.com/MLton/mlton/releases/download/on-20241230-release/mlton-20241230-1.amd64-linux.ubuntu-20.04_glibc2.31.tgz |
| 21 | tar xzf mlton-20241230-1.amd64-linux.ubuntu-20.04_glibc2.31.tgz --exclude='*/share' --strip-components=1 |
| 22 | rm mlton-20241230-1.amd64-linux.ubuntu-20.04_glibc2.31.tgz |
| 23 | |
| 24 | - name: Install bootstrap dependencies (ubuntu (arm64)) |
| 25 | if: ${{ contains(fromJSON('["ubuntu-22.04-arm", "ubuntu-24.04-arm"]'), inputs.runner) }} |
| 26 | shell: 'bash' |
| 27 | run: | |
| 28 | # Install dependencies (ubuntu (arm)) |
| 29 | sudo apt-get update |
| 30 | sudo apt-get install libgmp-dev |
| 31 | if [[ "${{ inputs.install-llvm }}" == "true" ]]; then sudo apt-get install llvm; fi |
| 32 | mkdir boot && cd boot |
| 33 | curl -sOL https://github.com/ii8/mlton-builds/releases/download/20241230/mlton-20241230.aarch64-linux-gnu.tar.gz |
| 34 | tar xzf mlton-20241230.aarch64-linux-gnu.tar.gz --exclude='*/share' --strip-components=1 |
| 35 | rm mlton-20241230.aarch64-linux-gnu.tar.gz |
| 36 | |
| 37 | - name: Install bootstrap dependencies (macos (amd64)) |
| 38 | if: ${{ contains(fromJSON('["macos-13"]'), inputs.runner) }} |
| 39 | shell: 'bash' |
| 40 | run: | |
| 41 | # Install dependencies (macos (amd64)) |
| 42 | # brew update |
| 43 | brew install -q gmp |
| 44 | echo "WITH_GMP_DIR=$(brew --prefix)" >> $GITHUB_ENV |
| 45 | if [[ "${{ inputs.install-llvm }}" == "true" ]]; then brew install llvm; echo "$(brew --prefix llvm)/bin" >> $GITHUB_PATH; fi |
| 46 | mkdir boot && cd boot |
| 47 | curl -sOL https://github.com/MLton/mlton/releases/download/on-20241230-release/mlton-20241230-1.amd64-darwin.macos-13_gmp-homebrew.tgz |
| 48 | tar xzf mlton-20241230-1.amd64-darwin.macos-13_gmp-homebrew.tgz --exclude='*/share' --strip-components=1 |
| 49 | rm mlton-20241230-1.amd64-darwin.macos-13_gmp-homebrew.tgz |
| 50 | |
| 51 | - name: Install bootstrap dependencies (macos (arm64)) |
| 52 | if: ${{ contains(fromJSON('["macos-14", "macos-15"]'), inputs.runner) }} |
| 53 | shell: 'bash' |
| 54 | run: | |
| 55 | # Install dependencies (macos (arm64)) |
| 56 | # brew update |
| 57 | brew install -q gmp |
| 58 | echo "WITH_GMP_DIR=$(brew --prefix)" >> $GITHUB_ENV |
| 59 | if [[ "${{ inputs.install-llvm }}" == "true" ]]; then brew install llvm; echo "$(brew --prefix llvm)/bin" >> $GITHUB_PATH; fi |
| 60 | mkdir boot && cd boot |
| 61 | curl -sOL https://github.com/MLton/mlton/releases/download/on-20241230-release/mlton-20241230-1.arm64-darwin.macos-14_gmp-homebrew.tgz |
| 62 | tar xzf mlton-20241230-1.arm64-darwin.macos-14_gmp-homebrew.tgz --exclude='*/share' --strip-components=1 |
| 63 | rm mlton-20241230-1.arm64-darwin.macos-14_gmp-homebrew.tgz |
| 64 | |
| 65 | - name: Install bootstrap dependencies (windows) |
| 66 | if: ${{ contains(fromJSON('["windows-2019", "windows-2022", "windows-2025"]'), inputs.runner) }} |
| 67 | shell: 'msys2 {0}' |
| 68 | run: | |
| 69 | # Install dependencies (windows) |
| 70 | pacboy --noconfirm -S --needed $(if [ ${MSYSTEM} == "CLANG64" ]; then echo clang:p ; else echo gcc:p; fi) gmp:p gmp-devel: |
| 71 | if [[ "${{ inputs.install-llvm }}" == "true" ]]; then pacboy --noconfirm -S --needed llvm:p ; fi |
| 72 | mkdir boot && cd boot |
| 73 | curl -sOL https://github.com/MLton/mlton/releases/download/on-20241230-release/mlton-20241230-1.amd64-mingw.windows-2022_msys2_${MSYSTEM}.tgz |
| 74 | tar xzf mlton-20241230-1.amd64-mingw.windows-2022_msys2_${MSYSTEM}.tgz --exclude='*/share' --strip-components=1 |
| 75 | rm mlton-20241230-1.amd64-mingw.windows-2022_msys2_${MSYSTEM}.tgz |