Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 46 additions & 13 deletions .github/workflows/binary-release-single.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ on:
mlton-compile-args:
required: false
type: string
mlton-binary-release-suffix:
mlton-binary-release:
required: false
type: string
mlton-binary-release-suffix-xtra:
required: false
type: string
workflow_call:
Expand All @@ -50,7 +53,10 @@ on:
mlton-compile-args:
required: false
type: string
mlton-binary-release-suffix:
mlton-binary-release:
required: false
type: string
mlton-binary-release-suffix-xtra:
required: false
type: string

Expand All @@ -65,15 +71,15 @@ jobs:

env:
MLTON_VERSION: ${{ inputs.mlton-version }}
RUNNER: ${{ inputs.runner }}
MLTON_BINARY_RELEASE: ${{ inputs.mlton-binary-release || '1' }}

steps:
- name: Configure git
run: git config --global core.autocrlf false
shell: bash

- name: Install msys2 (windows)
if: ${{ startsWith(inputs.runner, 'windows') }}
if: ${{ runner.os == 'Windows' }}
uses: msys2/setup-msys2@v2
with:
msystem: ${{ inputs.msystem }}
Expand All @@ -86,23 +92,47 @@ jobs:
github-cli:p

- name: Checkout
if: ${{ env.MLTON_BINARY_RELEASE_ARTIFACT_EXISTS != 'true' }}
uses: actions/checkout@v6
with:
sparse-checkout: .github

- name: Install bootstrap dependencies
uses: ./.github/actions/install-bootstrap-dependencies
with:
install-llvm: false

- name: Download and unpack source release
run: |
curl --fail -s -O -L https://github.com/${{ github.repository }}/releases/download/on-${{ inputs.mlton-version }}-release/mlton-${{ inputs.mlton-version }}.src.tgz
tar xzf mlton-${{ inputs.mlton-version }}.src.tgz --strip-components=1 || true
tar xzf mlton-${{ inputs.mlton-version }}.src.tgz --strip-components=1 || \
tar xzf mlton-${{ inputs.mlton-version }}.src.tgz --strip-components=1
rm mlton-${{ inputs.mlton-version }}.src.tgz

- name: Evaluate environment variables
shell: bash
run: |
export MLTON_HOST_ARCH=$(./bin/host-arch)
echo "MLTON_HOST_ARCH=$MLTON_HOST_ARCH" >> $GITHUB_ENV
export MLTON_TARGET_ARCH=${MLTON_HOST_ARCH}
echo "MLTON_TARGET_ARCH=$MLTON_TARGET_ARCH" >> $GITHUB_ENV
export MLTON_HOST_OS=$(./bin/host-os)
echo "MLTON_HOST_OS=$MLTON_HOST_OS" >> $GITHUB_ENV
export MLTON_TARGET_OS=${MLTON_HOST_OS}
echo "MLTON_TARGET_OS=$MLTON_TARGET_OS" >> $GITHUB_ENV
export MLTON_BINARY_RELEASE_SUFFIX=.${{ inputs.runner }}${{ inputs.msystem && format('_msys2_{0}', inputs.msystem) || '' }}${{ inputs.mlton-binary-release-suffix-xtra && format('_{0}', inputs.mlton-binary-release-suffix-xtra) || '' }}
echo "MLTON_BINARY_RELEASE_SUFFIX=$MLTON_BINARY_RELEASE_SUFFIX" >> $GITHUB_ENV
export MLTON_BINARY_RELEASE_NAME=mlton-${MLTON_VERSION}-${MLTON_BINARY_RELEASE}.${MLTON_TARGET_ARCH}-${MLTON_TARGET_OS}${MLTON_BINARY_RELEASE_SUFFIX}
echo "MLTON_BINARY_RELEASE_NAME=${MLTON_BINARY_RELEASE_NAME}" >> $GITHUB_ENV

- name: Check if binary release artifact exists
run: echo MLTON_BINARY_RELEASE_ARTIFACT_EXISTS=$(gh release view --json assets -q '[.assets[] | .name | ascii_downcase | . == ("${{ env.MLTON_BINARY_RELEASE_NAME }}.tgz" | ascii_downcase)] | any' -R MLton/mlton) >> $GITHUB_ENV
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install bootstrap dependencies
if: ${{ env.MLTON_BINARY_RELEASE_ARTIFACT_EXISTS != 'true' }}
uses: ./.github/actions/install-bootstrap-dependencies
with:
install-llvm: false

- name: Make binary release
if: ${{ env.MLTON_BINARY_RELEASE_ARTIFACT_EXISTS != 'true' }}
run: |
# make binary-release
PATH=$(pwd)/boot/bin:$PATH \
Expand All @@ -111,11 +141,14 @@ jobs:
OLD_MLTON_COMPILE_ARGS="${{ inputs.old-mlton-compile-args }}" \
MLTON_RUNTIME_ARGS="ram-slop 0.90 ${{ inputs.mlton-runtime-args }}" \
MLTON_COMPILE_ARGS="${{ inputs.mlton-compile-args }}" \
$( if [[ -n "$WITH_GMP_DIR" ]]; then echo "WITH_GMP_DIR=$WITH_GMP_DIR"; fi ) \
MLTON_BINARY_RELEASE_SUFFIX="${{ inputs.mlton-binary-release-suffix }}" \
${{ env.WITH_GMP_DIR && format('WITH_GMP_DIR={0}', env.WITH_GMP_DIR) || '' }} \
MLTON_VERSION="${{ env.MLTON_VERSION }}" \
MLTON_BINARY_RELEASE="${{ env.MLTON_BINARY_RELEASE }}" \
MLTON_BINARY_RELEASE_SUFFIX="${{ env.MLTON_BINARY_RELEASE_SUFFIX }}" \
binary-release

- name: Upload binary release
run: gh release upload on-${{ inputs.mlton-version }}-release mlton-${{ inputs.mlton-version }}*.tgz --clobber
if: ${{ env.MLTON_BINARY_RELEASE_ARTIFACT_EXISTS != 'true' }}
run: gh release upload on-${{ inputs.mlton-version }}-release mlton-${{ inputs.mlton-version }}*.tgz
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58 changes: 29 additions & 29 deletions .github/workflows/binary-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,87 +19,87 @@ jobs:
matrix:
include:
- runner: "ubuntu-24.04"
mlton-binary-release-suffix: ".${RUNNER}_glibc$(cc -dM -E - <<< '#include <stdlib.h>' | sed -En 's;#define __GLIBC__ (.*);\\1;p').$(cc -dM -E - <<< '#include <stdlib.h>' | sed -En 's;#define __GLIBC_MINOR__ (.*);\\1;p')"
mlton-binary-release-suffix-xtra: "glibc$(cc -dM -E - <<< '#include <stdlib.h>' | sed -En 's;#define __GLIBC__ (.*);\\1;p').$(cc -dM -E - <<< '#include <stdlib.h>' | sed -En 's;#define __GLIBC_MINOR__ (.*);\\1;p')"
- runner: "ubuntu-24.04"
mlton-compile-args: "-link-opt -static"
mlton-binary-release-suffix: ".${RUNNER}_static"
mlton-binary-release-suffix-xtra: "static"
- runner: "ubuntu-22.04"
mlton-binary-release-suffix: ".${RUNNER}_glibc$(cc -dM -E - <<< '#include <stdlib.h>' | sed -En 's;#define __GLIBC__ (.*);\\1;p').$(cc -dM -E - <<< '#include <stdlib.h>' | sed -En 's;#define __GLIBC_MINOR__ (.*);\\1;p')"
mlton-binary-release-suffix-xtra: "glibc$(cc -dM -E - <<< '#include <stdlib.h>' | sed -En 's;#define __GLIBC__ (.*);\\1;p').$(cc -dM -E - <<< '#include <stdlib.h>' | sed -En 's;#define __GLIBC_MINOR__ (.*);\\1;p')"
- runner: "ubuntu-22.04"
mlton-compile-args: "-link-opt -static"
mlton-binary-release-suffix: ".${RUNNER}_static"
mlton-binary-release-suffix-xtra: "static"
- runner: "ubuntu-24.04-arm"
mlton-binary-release-suffix: ".${RUNNER}_glibc$(cc -dM -E - <<< '#include <stdlib.h>' | sed -En 's;#define __GLIBC__ (.*);\\1;p').$(cc -dM -E - <<< '#include <stdlib.h>' | sed -En 's;#define __GLIBC_MINOR__ (.*);\\1;p')"
mlton-binary-release-suffix-xtra: "glibc$(cc -dM -E - <<< '#include <stdlib.h>' | sed -En 's;#define __GLIBC__ (.*);\\1;p').$(cc -dM -E - <<< '#include <stdlib.h>' | sed -En 's;#define __GLIBC_MINOR__ (.*);\\1;p')"
- runner: "ubuntu-24.04-arm"
mlton-compile-args: "-link-opt -static"
mlton-binary-release-suffix: ".${RUNNER}_static"
mlton-binary-release-suffix-xtra: "static"
- runner: "ubuntu-22.04-arm"
mlton-binary-release-suffix: ".${RUNNER}_glibc$(cc -dM -E - <<< '#include <stdlib.h>' | sed -En 's;#define __GLIBC__ (.*);\\1;p').$(cc -dM -E - <<< '#include <stdlib.h>' | sed -En 's;#define __GLIBC_MINOR__ (.*);\\1;p')"
mlton-binary-release-suffix-xtra: "glibc$(cc -dM -E - <<< '#include <stdlib.h>' | sed -En 's;#define __GLIBC__ (.*);\\1;p').$(cc -dM -E - <<< '#include <stdlib.h>' | sed -En 's;#define __GLIBC_MINOR__ (.*);\\1;p')"
- runner: "ubuntu-22.04-arm"
mlton-compile-args: "-link-opt -static"
mlton-binary-release-suffix: ".${RUNNER}_static"
mlton-binary-release-suffix-xtra: "static"
- runner: "macos-15-intel"
mlton-binary-release-suffix: ".${RUNNER}_gmp-homebrew"
mlton-binary-release-suffix-xtra: "gmp-homebrew"
- runner: "macos-15-intel"
mlton-compile-args: "-gmp-link-opt $(brew --prefix)/lib/libgmp.a"
mlton-binary-release-suffix: ".${RUNNER}_gmp-static"
mlton-binary-release-suffix-xtra: "gmp-static"
- runner: "macos-14"
mlton-binary-release-suffix: ".${RUNNER}_gmp-homebrew"
mlton-binary-release-suffix-xtra: "gmp-homebrew"
- runner: "macos-14"
mlton-compile-args: "-gmp-link-opt $(brew --prefix)/lib/libgmp.a"
mlton-binary-release-suffix: ".${RUNNER}_gmp-static"
mlton-binary-release-suffix-xtra: "gmp-static"
- runner: "macos-15"
mlton-binary-release-suffix: ".${RUNNER}_gmp-homebrew"
mlton-binary-release-suffix-xtra: "gmp-homebrew"
- runner: "macos-15"
mlton-compile-args: "-gmp-link-opt $(brew --prefix)/lib/libgmp.a"
mlton-binary-release-suffix: ".${RUNNER}_gmp-static"
mlton-binary-release-suffix-xtra: "gmp-static"
- runner: "macos-26"
mlton-binary-release-suffix: ".${RUNNER}_gmp-homebrew"
mlton-binary-release-suffix-xtra: "gmp-homebrew"
- runner: "macos-26"
mlton-compile-args: "-gmp-link-opt $(brew --prefix)/lib/libgmp.a"
mlton-binary-release-suffix: ".${RUNNER}_gmp-static"
mlton-binary-release-suffix-xtra: "gmp-static"
- runner: "windows-2025"
msystem: "mingw64"
mlton-binary-release-suffix: ".${RUNNER}_msys2_${MSYSTEM}"
mlton-binary-release-suffix-xtra: ""
- runner: "windows-2025"
msystem: "mingw64"
mlton-compile-args: "-link-opt -static"
mlton-binary-release-suffix: ".${RUNNER}_msys2_${MSYSTEM}_static"
mlton-binary-release-suffix-xtra: "static"
- runner: "windows-2025"
msystem: "ucrt64"
mlton-binary-release-suffix: ".${RUNNER}_msys2_${MSYSTEM}"
mlton-binary-release-suffix-xtra: ""
- runner: "windows-2025"
msystem: "ucrt64"
mlton-compile-args: "-link-opt -static"
mlton-binary-release-suffix: ".${RUNNER}_msys2_${MSYSTEM}_static"
mlton-binary-release-suffix-xtra: "static"
- runner: "windows-2025"
msystem: "clang64"
mlton-binary-release-suffix: ".${RUNNER}_msys2_${MSYSTEM}"
mlton-binary-release-suffix-xtra: ""
- runner: "windows-2025"
msystem: "clang64"
mlton-compile-args: "-link-opt -static"
mlton-binary-release-suffix: ".${RUNNER}_msys2_${MSYSTEM}_static"
mlton-binary-release-suffix-xtra: "static"
- runner: "windows-2022"
msystem: "mingw64"
mlton-binary-release-suffix: ".${RUNNER}_msys2_${MSYSTEM}"
mlton-binary-release-suffix-xtra: ""
- runner: "windows-2022"
msystem: "mingw64"
mlton-compile-args: "-link-opt -static"
mlton-binary-release-suffix: ".${RUNNER}_msys2_${MSYSTEM}_static"
mlton-binary-release-suffix-xtra: "static"
- runner: "windows-2022"
msystem: "ucrt64"
mlton-binary-release-suffix: ".${RUNNER}_msys2_${MSYSTEM}"
mlton-binary-release-suffix-xtra: ""
- runner: "windows-2022"
msystem: "ucrt64"
mlton-compile-args: "-link-opt -static"
mlton-binary-release-suffix: ".${RUNNER}_msys2_${MSYSTEM}_static"
mlton-binary-release-suffix-xtra: "static"
- runner: "windows-2022"
msystem: "clang64"
mlton-binary-release-suffix: ".${RUNNER}_msys2_${MSYSTEM}"
mlton-binary-release-suffix-xtra: ""
- runner: "windows-2022"
msystem: "clang64"
mlton-compile-args: "-link-opt -static"
mlton-binary-release-suffix: ".${RUNNER}_msys2_${MSYSTEM}_static"
mlton-binary-release-suffix-xtra: "static"
uses: ./.github/workflows/binary-release-single.yml
with:
mlton-version: ${{ inputs.mlton-version }}
Expand All @@ -109,5 +109,5 @@ jobs:
old-mlton-compile-args: ${{ matrix.old-mlton-compile-args }}
mlton-runtime-args: ${{ matrix.mlton-runtime-args }}
mlton-compile-args: ${{ matrix.mlton-compile-args }}
mlton-binary-release-suffix: ${{ matrix.mlton-binary-release-suffix }}
mlton-binary-release-suffix-xtra: ${{ matrix.mlton-binary-release-suffix-xtra }}
secrets: inherit
18 changes: 17 additions & 1 deletion .github/workflows/source-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,33 @@ on:
jobs:
source-release:
runs-on: ubuntu-24.04

env:
MLTON_VERSION: ${{ inputs.mlton-version }}

steps:
- name: Check if source release artifact exists
run: echo MLTON_SOURCE_RELEASE_ARTIFACT_EXISTS=$(gh release view --json assets -q '[.assets[] | .name | ascii_downcase | . == ("mlton-${{ env.MLTON_VERSION }}.src.tgz" | ascii_downcase)] | any' -R MLton/mlton) >> $GITHUB_ENV
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout
if: ${{ env.MLTON_SOURCE_RELEASE_ARTIFACT_EXISTS != 'true' }}
uses: actions/checkout@v6
with:
ref: on-${{ inputs.mlton-version }}-release
fetch-depth: 0

- name: Install guide dependencies
if: ${{ env.MLTON_SOURCE_RELEASE_ARTIFACT_EXISTS != 'true' }}
uses: ./.github/actions/install-guide-dependencies

- name: Make source release
if: ${{ env.MLTON_SOURCE_RELEASE_ARTIFACT_EXISTS != 'true' }}
run: make MLTON_VERSION="${{ inputs.mlton-version }}" source-release

- name: Upload source release
run: gh release upload on-${{ inputs.mlton-version }}-release mlton-${{ inputs.mlton-version }}.src.tgz --clobber
if: ${{ env.MLTON_SOURCE_RELEASE_ARTIFACT_EXISTS != 'true' }}
run: gh release upload on-${{ inputs.mlton-version }}-release mlton-${{ inputs.mlton-version }}.src.tgz
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading