Skip to content

ci: enable pre-release workflow with dispatch #55

ci: enable pre-release workflow with dispatch

ci: enable pre-release workflow with dispatch #55

Workflow file for this run

#
# Copyright (c) 2024, Trail of Bits, Inc.
#
# This source code is licensed in accordance with the terms specified in
# the LICENSE file found in the root directory of this source tree.
#
name: "Pre Release"
on:
workflow_run:
workflows: ["CI"]
types:
- completed
branches:
- "main"
workflow_dispatch:
pull_request:
branches:
- "main"
permissions: write-all
jobs:
build_prerelease:
strategy:
matrix:
llvm-version: [20]
image-version: [22.04]
name: "Pre Release and Build Doc"
runs-on: ubuntu-${{ matrix.image-version }}
if: ${{ github.event.workflow_run.conclusion == 'success' }}
timeout-minutes: 60
container:
image:
ghcr.io/lifting-bits/patchestry-ubuntu-${{ matrix.image-version }}-llvm-${{ matrix.llvm-version }}-dev:latest
env:
CMAKE_PREFIX_PATH: "/usr/lib/llvm-${{ matrix.llvm-version }}/lib/cmake/mlir/;/usr/lib/llvm-${{ matrix.llvm-version }}/lib/cmake/clang/"
TOOLCHAIN: ${{ github.workspace }}/cmake/lld.toolchain.cmake
LLVM_EXTERNAL_LIT: "/usr/local/bin/lit"
steps:
- name: Clone the Patchestry repository
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 1
- name: Free up disk space
run: |
docker system prune -af --volumes || true
sudo apt-get clean || true
sudo rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* || true
rm -rf /gha-runner/usr/local/lib/android || true
rm -rf /gha-runner/usr/local/share/boost || true
- name: Configure build
run: cmake --preset ci -DLLVM_Z3_INSTALL_DIR=/usr/local
- name: Build release
run: cmake --build --preset ci-release -j $(nproc)
- name: Build Patchestry Doc
run: cmake --build --preset ci-release --target mlir-doc
- name: Build Patchestry Pages
run: |
sh ./www/setup.sh _site ./builds/ci/
pip install mkdocs mkdocs-material
mkdocs build --config-file _site/mkdocs.yml --site-dir _site/site
- name: Package
run: cpack --preset ci
- name: Upload Patchestry build artifact
uses: actions/upload-artifact@v4
with:
name: Patchestry
path: ./builds/ci/package/*
retention-days: 1
- name: Publish Pre-Release
uses: softprops/action-gh-release@v1
with:
tag_name: "latest"
prerelease: true
generate_release_notes: true
files: |
./LICENSE
./builds/ci/package/*
- name: Upload Patchestry sites
uses: actions/upload-artifact@v4
with:
name: mkdocs-sites
path: _site
if-no-files-found: error
deploy_doc:
needs: build_prerelease
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Clone the Patchestry repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Download Patchestry sites
uses: actions/download-artifact@v4
with:
name: mkdocs-sites
path: _site
# Deploy with the Docker-based action in a non-containerized job
- name: Deploy Patchestry sites to gh-pages
uses: mhausenblas/mkdocs-deploy-gh-pages@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CONFIG_FILE: _site/mkdocs.yml