Update and rename cmake.yml to build-and-package.yml #1
This file contains 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 and Package | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ main ] | |
paths-ignore: | |
- '**.md' | |
- '**.png' | |
- '**.svg' | |
- '.gitignore' | |
- '**.html' | |
- '**.css' | |
- '**.js' | |
- '**.yaml' | |
- '!**/*build*.yaml' | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build-and-package: | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- { | |
os: Windows-2022, | |
build_arch: Win32, | |
build_type: MinSizeRel, | |
build_generator: Visual Studio 17 2022, | |
clearname: win32 | |
} | |
- { | |
os: windows-2022, | |
build_arch: x64, | |
build_type: MinSizeRel, | |
build_generator: Visual Studio 17 2022, | |
clearname: win64 | |
} | |
- { | |
os: ubuntu-22.04, | |
build_arch: x64, | |
build_type: MinSizeRel, | |
build_generator: Ninja, | |
clearname: linux | |
} | |
- { | |
os: macos-12, | |
build_arch: x64, | |
build_type: MinSizeRel, | |
build_generator: Ninja, | |
clearname: macos | |
} | |
runs-on: ${{ matrix.config.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: seanmiddleditch/gha-setup-ninja@v3 | |
if: "contains(matrix.config.os, 'Macos') || contains(matrix.config.os, 'Ubuntu')" | |
- name: Generate ${{ matrix.config.clearname }} | |
if: "contains(matrix.config.build_generator, 'Visual Studio')" | |
run: | | |
cmake -S . -B Build -A ${{ matrix.config.build_arch }} -G "${{ matrix.config.build_generator}}" -DGITHUB_CI=ON -DCMAKE_RUNTIME_OUTPUT_DIRECTORY="../${{ matrix.config.clearname }}" | |
- name: Generate ${{ matrix.config.clearname }} | |
if: "!contains(matrix.config.build_generator, 'Visual Studio')" | |
run: | | |
cmake -S . -B Build -G "${{ matrix.config.build_generator}}" -DGITHUB_CI=ON -DCMAKE_RUNTIME_OUTPUT_DIRECTORY="../${{ matrix.config.clearname }}" | |
- name: Build ${{ matrix.config.clearname }} | |
run: | | |
cmake --build Build --config ${{ matrix.config.build_type }} | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: esd ${{ matrix.config.clearname }} | |
path: | | |
**/esd | |
**/esd.exe | |
if-no-files-found: error | |
retention-days: 7 | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: esd | |
path: | | |
**/esd | |
**/esd.exe | |
if-no-files-found: error | |
retention-days: 7 |