Skip to content

[chore] modify build script #14

[chore] modify build script

[chore] modify build script #14

Workflow file for this run

name: Build project
on:
push:
branches: [ ng ]
pull_request:
branches: [ ng ]
jobs:
build:
strategy:
matrix:
os:
- ubuntu-24.04
version:
- 2024.07
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Cache bsc
id: cache-bsc
uses: actions/cache@v4
with:
path: bsc
key: ${{ matrix.os }}-bsc-${{ matrix.version }}-${{ hashFiles('.github/workflows/build.yml') }}
- name: Download bsc
if: steps.cache-bsc.outputs.cache-hit != 'true'
run: |
wget -qO- https://github.com/B-Lang-org/bsc/releases/download/${{ matrix.version }}/bsc-${{ matrix.version }}-${{ matrix.os }}.tar.gz | tar xzf -
mv bsc-${{ matrix.version }}-${{ matrix.os }} bsc
- name: Install bsc-contrib
if: steps.cache-bsc.outputs.cache-hit != 'true'
run: |
export PATH=$PATH:${{ github.workspace }}/bsc/bin
git clone https://github.com/B-Lang-org/bsc-contrib.git
cd bsc-contrib
make -j$(nproc) PREFIX="$PWD/../bsc"
cd ..
- name: Cache Build Artifacts
uses: actions/cache@v4
with:
path: build
key: build-bsc-${{ matrix.version }}-${{ matrix.os }}-${{ github.run_id }}
restore-keys: |
build-bsc-${{ matrix.version }}-${{ matrix.os }}
- name: Build Project
run: |
rm -rf build/generated
export PATH=$PATH:${{ github.workspace }}/bsc/bin
make build
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
path: build/generated