Skip to content

Commit 1414626

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 1414626

File tree

2 files changed

+89
-0
lines changed

2 files changed

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

0 commit comments

Comments
 (0)