Skip to content

GitHub Actions: disable release on PR #363

GitHub Actions: disable release on PR

GitHub Actions: disable release on PR #363

Workflow file for this run

name: CMake
on:
push:
branches: [ main ]
pull_request:
env:
build_directory: ${{github.workspace}}/BUILD
build_type: Release
release_name: build_${{github.run_number}}
jobs:
check:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: clang-format Check (linux64)
shell: bash
run: find . -iname '*.hh' -o -iname '*.cc' -o -iname '*.ixx' | xargs clang-format-18 --dry-run -Werror
build:
needs: check
strategy:
matrix:
os: [windows-2022, ubuntu-24.04, macos-14]
platform: [32, 64]
exclude:
- os: ubuntu-24.04
platform: 32
- os: macos-14
platform: 32
runs-on: ${{matrix.os}}
steps:
- name: Customize Software (Linux)
if: ${{ matrix.os == 'ubuntu-24.04' }}
run: sudo apt-get install clang-18 lld-18 clang-tools-18 libc++-18-dev ninja-build
- name: Customize Software (macOS)
if: ${{ matrix.os == 'macos-14' }}
run: brew install llvm@18 ninja
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'true'
- name: CMake Configure (win32)
if: ${{ matrix.os == 'windows-2022' && matrix.platform == 32 }}
run: cmake -B ${{env.build_directory}} -G "Visual Studio 17 2022" -A Win32 -DCMAKE_BUILD_TYPE=${{env.build_type}} -DREDUMPER_VERSION_BUILD=${{github.run_number}}
- name: CMake Configure (win64)
if: ${{ matrix.os == 'windows-2022' && matrix.platform == 64 }}
run: cmake -B ${{env.build_directory}} -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=${{env.build_type}} -DREDUMPER_VERSION_BUILD=${{github.run_number}}
- name: CMake Configure (linux64)
if: ${{ matrix.os == 'ubuntu-24.04' }}
run: CC=clang-18 CXX=clang++-18 cmake -B ${{env.build_directory}} -G "Ninja" -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON -DREDUMPER_CLANG_LINK_OPTIONS="-static" -DCMAKE_BUILD_TYPE=${{env.build_type}} -DREDUMPER_VERSION_BUILD=${{github.run_number}}
- name: CMake Configure (macos64)
if: ${{ matrix.os == 'macos-14' }}
run: CC=$(brew --prefix llvm@18)/bin/clang CXX=$(brew --prefix llvm@18)/bin/clang++ cmake -B ${{env.build_directory}} -G "Ninja" -DREDUMPER_CLANG_LINK_OPTIONS="-L$(brew --prefix llvm@18)/lib/c++" -DCMAKE_BUILD_TYPE=${{env.build_type}} -DREDUMPER_VERSION_BUILD=${{github.run_number}}
- name: CMake Build
run: cmake --build ${{env.build_directory}} --config ${{env.build_type}}
- name: CTest
working-directory: ${{env.build_directory}}
run: ctest -C ${{env.build_type}}
- name: CPack
working-directory: ${{env.build_directory}}
run: cpack -G ZIP --config CPackConfig.cmake
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{env.release_name}}_${{matrix.os}}_${{matrix.platform}}
path: ${{env.build_directory}}/redumper-*.zip
release:
if: github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Artifact
uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: 'Create Release'
shell: bash
run: |
for f in redumper-*.zip; do FILES+=" $f"; done
gh release create --generate-notes ${{ env.release_name }} $FILES
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}