ci(github): replace macOS 11 with 12 #165
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push, pull_request] | |
jobs: | |
linux: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: sudo apt-get update && sudo apt-get install -y libgmp-dev | |
- name: Run CI script | |
run: ./linux-ci.sh | |
- name: Add artifact name to env | |
run: | | |
printf \ | |
'ARTIFACT_NAME=initool-v%s-%s-linux-%s\n' \ | |
"$(cat VERSION)" \ | |
"$(git rev-parse --short=7 HEAD)" \ | |
"$(uname -m)" \ | |
>>"$GITHUB_ENV" \ | |
; | |
- name: Upload Linux binary | |
uses: actions/upload-artifact@v4 | |
with: | |
name: '${{ env.ARTIFACT_NAME }}' | |
path: initool | |
macos: | |
runs-on: '${{ matrix.os }}' | |
strategy: | |
matrix: | |
os: ["macos-12", "macos-14"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: brew install dylibbundler mlton | |
- name: Build and test | |
run: | | |
make | |
- name: Bundle dynamic libraries | |
run: | | |
dylibbundler --bundle-deps --create-dir --fix-file initool | |
- name: Add artifact name to env | |
run: | | |
printf \ | |
'ARTIFACT_NAME=initool-v%s-%s-macos-%s-%s\n' \ | |
"$(cat VERSION)" \ | |
"$(git rev-parse --short=7 HEAD)" \ | |
"$(sw_vers | awk '/ProductVersion/ { print substr($2, 1, index($2, ".") - 1) }')" \ | |
"$(uname -m)" \ | |
>>"$GITHUB_ENV" \ | |
; | |
- name: Upload macOS binary | |
uses: actions/upload-artifact@v4 | |
with: | |
name: '${{ env.ARTIFACT_NAME }}' | |
path: | | |
initool | |
libs/ | |
windows: | |
runs-on: windows-2019 | |
steps: | |
- name: 'Disable `autocrlf` in Git' | |
run: git config --global core.autocrlf false | |
- uses: actions/checkout@v4 | |
- name: Install MoSML | |
run: | | |
New-Item -ItemType Directory -Path C:\mosml -Force | |
Invoke-WebRequest -Uri https://dbohdan.com/dist/mosml-2.10.1-win32.7z -OutFile C:\mosml\mosml.7z | |
7z x -oC:\mosml C:\mosml\mosml.7z | |
- name: Build initool | |
run: .\build.cmd /batch /package | |
- name: Check that initool runs | |
run: .\initool.exe version | |
- name: Add artifact name to env | |
run: | | |
$artifact = Get-ChildItem -Filter *.zip | Select-Object -First 1 | |
Write-Output "ARTIFACT_NAME=$($artifact.Basename)" ` | |
| Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
7z x -y $artifact | |
- name: Upload Win32 binary | |
uses: actions/upload-artifact@v4 | |
with: | |
name: '${{ env.ARTIFACT_NAME }}' | |
path: | | |
camlrt.dll | |
initool.exe |