|
| 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/ |
0 commit comments