Skip to content

Commit cd2c28f

Browse files
author
Eduardo Leegwater Simões
committed
Add compiler building workflow
The compiler is built for the following hosts: - x86_64-unknown-linux-gnu - x86_64-apple-darwin - aarch64-apple-darwin And produces code for the following targets: - The host triple - wasm32-unknown-unknown - wasm64-unknown-unknown
1 parent 826db24 commit cd2c28f

File tree

2 files changed

+88
-0
lines changed

2 files changed

+88
-0
lines changed

.github/workflows/dusk.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Instructions for GitHub to build Dusk's smart contract compilers.
2+
3+
on:
4+
pull_request:
5+
push:
6+
tags:
7+
- "v*.*.*"
8+
branches:
9+
- master
10+
11+
name: Dusk Contract Compilers
12+
13+
jobs:
14+
target:
15+
strategy:
16+
matrix:
17+
target: [
18+
x86_64-unknown-linux-gnu,
19+
x86_64-apple-darwin,
20+
aarch64-apple-darwin,
21+
]
22+
include:
23+
- os: ubuntu-latest
24+
target: x86_64-unknown-linux-gnu
25+
- os: macos-latest-large
26+
target: x86_64-apple-darwin
27+
- os: macos-latest-xlarge
28+
target: aarch64-apple-darwin
29+
runs-on: ${{ matrix.os }}
30+
steps:
31+
- name: Check out repository
32+
uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 16
35+
36+
- name: Setup dependencies
37+
if: matrix.os == 'ubuntu-latest'
38+
run: sudo apt update && sudo apt install -y ninja-build
39+
40+
- name: Setup dependencies
41+
if: startsWith(matrix.os, 'macos')
42+
run: |
43+
brew install ninja gettext &&
44+
brew link --force gettext
45+
- name: Generate configuration
46+
run: |
47+
HOST=${{ matrix.target }} envsubst < config.template.toml > config.toml &&
48+
cat config.toml
49+
- name: Run build
50+
run: ./x.py dist
51+
52+
- name: Set artifact name
53+
id: artifact-name
54+
run: |
55+
if [ "${{ github.ref_type }}" == "tag" ]; then
56+
echo "name=duskc-${{ matrix.target }}-${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
57+
else
58+
echo "name=duskc-${{ matrix.target }}-${{ github.sha }}" >> "$GITHUB_OUTPUT"
59+
fi
60+
- name: Upload build
61+
uses: actions/upload-artifact@v3
62+
with:
63+
name: ${{ steps.artifact-name.outputs.name }}
64+
path: build/dist/

config.template.toml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
change-id = 131075
2+
3+
[llvm]
4+
download-ci-llvm = false
5+
6+
[build]
7+
host = [ "${HOST}" ]
8+
target = [
9+
"${HOST}",
10+
"wasm32-unknown-unknown",
11+
"wasm64-unknown-unknown"
12+
]
13+
docs = false
14+
extended = true
15+
16+
[rust]
17+
channel = "nightly"
18+
description = "Dusk Network's Smart Contract Compiler"
19+
20+
lld = true
21+
22+
[dist]
23+
compression-formats = ["gz"]
24+
compression-profile = "best"

0 commit comments

Comments
 (0)