ci: enable pre-release workflow with dispatch #50
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
| # | |
| # 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" | |
| 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 volume prune -f || true | |
| docker system prune -af --volumes || true | |
| sudo apt-get clean || true | |
| sudo rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | |
| rm -rf /gha-runner/usr/local/lib/android | |
| rm -rf /gha-runner/usr/local/share/boost | |
| df -h | |
| - name: Configure build | |
| run: cmake --preset ci | |
| - name: Build release | |
| run: cmake --build --preset ci-release -j $(nproc) | |
| - 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/* | |
| build_doc: | |
| strategy: | |
| matrix: | |
| llvm-version: [20] | |
| image-version: [22.04] | |
| name: "Build Patchestry doc" | |
| runs-on: ubuntu-${{ matrix.image-version }} | |
| 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 volume prune -f || true | |
| docker system prune -af --volumes || true | |
| sudo apt-get clean || true | |
| sudo rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | |
| rm -rf /gha-runner/usr/local/lib/android | |
| rm -rf /gha-runner/usr/local/share/boost | |
| df -h | |
| - name: Configure build | |
| run: cmake --preset ci -DLLVM_Z3_INSTALL_DIR=/usr/local | |
| - name: Build Patchestry Doc | |
| run: cmake --build --preset ci-release --target mlir-doc | |
| - name: Build Pages | |
| run: | | |
| sh ./www/setup.sh _site ./builds/ci/ | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Install MkDocs | |
| run: | | |
| pip install mkdocs mkdocs-material | |
| - name: Deploy docs | |
| run: | | |
| git config --global --add safe.directory ${{ github.workspace }} | |
| cd _site | |
| mkdocs gh-deploy --force --config-file mkdocs.yml | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |