Skip to content

build

build #46

Workflow file for this run

name: build
on:
workflow_dispatch:
permissions:
contents: write
pull-requests: write
env:
SRC_BRANCH: main
BUILD_BRANCH: build
BUILD_DIRNAME: build
BUILD_BRANCH_REPO_DIRNAME: build.repo
jobs:
build-wasm:
runs-on: ubuntu-latest
container:
image: juniorrojas/llvm-enzyme:latest
steps:
- name: Clone src branch
uses: actions/checkout@v4
with:
ref: ${{ env.SRC_BRANCH }}
- name: Build WASM
run: |
export LLVM_BIN_DIR=/usr/lib/llvm-11/bin
export ENZYME=/Enzyme/enzyme/build/Enzyme/LLVMEnzyme-11.so
./build.sh
- name: Upload WASM
uses: actions/upload-artifact@v4
with:
name: algovivo.wasm
path: build/algovivo.wasm
build-js:
runs-on: ubuntu-latest
steps:
- name: Clone src branch
uses: actions/checkout@v4
with:
ref: ${{ env.SRC_BRANCH }}
- name: Build lib
run: |
npm ci
npm run build
- name: Upload lib build
uses: actions/upload-artifact@v4
with:
name: build-js
path: ./build
push-build:
runs-on: ubuntu-latest
needs: [build-wasm, build-js]
steps:
- name: Download WASM build
uses: actions/download-artifact@v4
with:
name: algovivo.wasm
path: ${{ env.BUILD_DIRNAME }}/
- name: Download JS build
uses: actions/download-artifact@v4
with:
name: build-js
path: ./build
- name: Configure git
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- run: ls -l build
- name: Clone build branch
uses: actions/checkout@v4
with:
ref: ${{ env.BUILD_BRANCH }}
path: ${{ env.BUILD_BRANCH_REPO_DIRNAME }}
- name: Push to build branch
run: |
rm -rf ${{ env.BUILD_BRANCH_REPO_DIRNAME }}/${{ env.BUILD_DIRNAME }}
cp -r build ${{ env.BUILD_BRANCH_REPO_DIRNAME }}
cd ${{ env.BUILD_BRANCH_REPO_DIRNAME }}
ls -la
ls -la ${{ env.BUILD_DIRNAME }}
git config --global user.name "GitHub Actions"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add build
git commit -m "Update build"
git push origin ${{ env.BUILD_BRANCH }}