2024-12-03 #10
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build MLIR and Upload to Release | |
on: | |
release: | |
types: [published] | |
jobs: | |
build-mlir: | |
name: Build MLIR from Source | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone LLVM and MLIR repository | |
run: | | |
git clone https://github.com/llvm/llvm-project.git | |
cd llvm-project | |
git checkout d401987fe349a87c53fe25829215b080b70c0c1a | |
cd .. | |
- name: Set up Python 3 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y cmake ninja-build | |
- name: Build MLIR | |
run: | | |
mkdir build | |
cd build | |
cmake -G Ninja \ | |
-DLLVM_ENABLE_PROJECTS="mlir" \ | |
-DLLVM_TARGETS_TO_BUILD="X86" \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
../llvm-project/llvm | |
ninja | |
- name: Archive build results | |
run: | | |
tar -czvf mlir.tar.gz build/ | |
if: success() | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: mlir | |
path: mlir.tar.gz | |
upload-to-release: | |
name: Upload to GitHub Release | |
needs: build-mlir | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download build artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: mlir | |
- name: Upload MLIR build to GitHub Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: mlir.tar.gz | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |