Skip to content

Using matrix to release on linux/macos #10

Using matrix to release on linux/macos

Using matrix to release on linux/macos #10

Workflow file for this run

name: Release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
build-and-release:
strategy:
matrix:
platform:
- os: ubuntu-latest
suffix: linux
- os: macos-14
suffix: darwin-arm64
runs-on: ${{ matrix.platform.os }}
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Cache QBE
id: cache-qbe
uses: actions/cache@v3
with:
path: ./qbe/qbe-1.2
key: qbe-1.2
- name: Install QBE
run: |
mkdir -p qbe
cd qbe
wget https://c9x.me/compile/release/qbe-1.2.tar.xz
tar -xf qbe-1.2.tar.xz
cd qbe-1.2
make
if: steps.cache-qbe.outputs.cache-hit != 'true'
- name: Setup QBE
run: |
echo "PATH=$(pwd)/qbe/qbe-1.2:$PATH" >> $GITHUB_ENV
- name: Install ext dependencies
run: ./configure-libgc.sh
- name: Install abra
run: |
mkdir abra-installation
wget https://github.com/kengorab/abra-lang/releases/latest/download/abra-${{ matrix.platform.suffix }}.tar.gz
tar -xzf abra-${{ matrix.platform.suffix }}.tar.gz -C abra-installation
echo "PATH=$(pwd)/abra-installation:$PATH" >> $GITHUB_ENV
echo "ABRA_HOME=`realpath $(pwd)/abra-installation/std`" >> $GITHUB_ENV
- name: Build package
run: |
cd selfhost
./gen-pkg/gen.sh ${{ matrix.platform.suffix }} ${{ github.ref_name }}
- name: Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref }}
files: selfhost/gen-pkg/abra-${{ matrix.platform.suffix }}.tar.gz
append_body: true