Skip to content

Add Dusk contract build #19

Add Dusk contract build

Add Dusk contract build #19

Workflow file for this run

# Instructions for GitHub to build Dusk's smart contract compilers.
on:
pull_request:
push:
tags:
- "v*.*.*"
branches:
- master
name: Dusk Contract Compilers
jobs:
target:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
target: [
x86_64-unknown-linux-gnu,
x86_64-apple-darwin,
]
exclude:
- os: ubuntu-latest
target: x86_64-apple-darwin
- os: macos-latest
target: x86_64-unknown-linux-gnu
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 5
- name: Install dependencies
if: matrix.os == 'ubuntu-latest'
run: sudo apt update && sudo apt install -y ninja-build
- name: Install dependencies
if: matrix.os == 'macos-latest'
run: brew install ninja openssl@3
- name: Run build
run: ./x build --host ${{ matrix.target }}
- name: Archive build directory
run: |
tar -czvf duskc.tar.gz \
build/${{ matrix.target }}/stage2*
- name: Set artifact name
id: artifact-name
run: |
if [ "${{ github.ref_type }}" == "tag" ]; then
echo "name=duskc-${{ matrix.target }}-${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
else
echo "name=duskc-${{ matrix.target }}-${{ github.sha }}" >> "$GITHUB_OUTPUT"
fi
- name: Upload build
uses: actions/upload-artifact@v3
with:
name: ${{ steps.artifact-name.outputs.name }}
path: duskc.tar.gz