Specify Sync
and Send
#186
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: release | |
# The build always runs, but only releases on tag, see the last step. | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- "v*.*.*" | |
paths-ignore: | |
- "README.md" | |
- "LICENSE" | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
- os: macos-latest | |
target: x86_64-apple-darwin | |
- os: macos-latest | |
target: aarch64-apple-darwin | |
- os: windows-latest | |
target: x86_64-pc-windows-msvc | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 15 | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- run: | | |
if [[ ${{ matrix.os }} = "windows-latest" ]]; then | |
EXT=".exe" | |
else | |
EXT="" | |
fi | |
echo "EXT: $EXT" | |
echo "ext=$EXT" >> $GITHUB_OUTPUT | |
id: check | |
shell: bash | |
- run: | | |
rustup update stable | |
rustup default stable | |
rustup target add ${{ matrix.target }} | |
- run: | | |
cd xrcf-bin/ | |
cargo build --release --target ${{ matrix.target }} | |
cd .. | |
BIN_SRC="target/${{ matrix.target }}/release/xrcf-bin${{ steps.check.outputs.ext }}" | |
echo "BIN_SRC: $BIN_SRC" | |
BIN_DST="target/release/xrcf-bin-${{ matrix.target }}${{ steps.check.outputs.ext }}" | |
echo "BIN_DST: $BIN_DST" | |
mv -v $BIN_SRC $BIN_DST | |
echo "bin_dst=$BIN_DST" >> $GITHUB_OUTPUT | |
cd arnoldc/ | |
cargo build --release --target ${{ matrix.target }} | |
cd .. | |
ARNOLDC_SRC="target/${{ matrix.target }}/release/arnoldc${{ steps.check.outputs.ext }}" | |
echo "ARNOLDC_SRC: $ARNOLDC_SRC" | |
ARNOLDC_DST="target/release/arnoldc-${{ matrix.target }}${{ steps.check.outputs.ext }}" | |
echo "ARNOLDC_DST: $ARNOLDC_DST" | |
mv -v $ARNOLDC_SRC $ARNOLDC_DST | |
echo "arnoldc_dst=$ARNOLDC_DST" >> $GITHUB_OUTPUT | |
id: release | |
shell: bash | |
# Hardcoded commit hash to mitigate supply chain attacks. | |
- uses: softprops/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974 # v2.1.0 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
body: | | |
Notable changes since the last release are documented in the [CHANGELOG.md](https://github.com/rikhuijzer/xrcf/blob/main/CHANGELOG.md) file. | |
The [xrcf library](https://crates.io/xrcf) provides infrastructure to build compilers and is the main way to use xrcf. Each release also contains two example compilers: | |
- `xrcf-bin` is a compiler that can compile basic MLIR programs to LLVM IR, and can be used for testing the xrcf package. This binary contains all the default passes such as `--convert-func-to-llvm`. | |
- `arnoldc` is a compiler that can compile basic ArnoldC programs to LLVM IR. Next to the default passes, this binary contains the pass `--convert-arnold-to-mlir` which can lower ArnoldC programs to MLIR. From there, the default passes such as `--convert-func-to-llvm` can be used to lower ArnoldC to LLVM IR. | |
fail_on_unmatched_files: true | |
files: | | |
${{ steps.release.outputs.bin_dst }} | |
${{ steps.release.outputs.arnoldc_dst }} |