Work in progress #31
Workflow file for this run
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: Release | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
jobs: | |
release: | |
runs-on: ${{ matrix.config.os }} | |
permissions: | |
contents: write | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- name: macOS | |
os: macos-latest | |
- name: Ubuntu | |
os: ubuntu-latest | |
- name: WebAssembly | |
os: ubuntu-latest | |
- name: Windows | |
os: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Cache Dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.conan2/p | |
C:/Users/runneradmin/.conan2/p/ | |
key: ${{ matrix.config.name }}-${{ hashFiles('**/conanfile.txt') }} | |
restore-keys: | | |
${{ matrix.config.name }}-${{ hashFiles('**/conanfile.txt') }} | |
${{ matrix.config.name }}- | |
- name: Prepare Build Directory | |
run: mkdir build | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.12" | |
- name: Install Conan | |
run: pip install conan | |
- name: Detect Conan Profile | |
run: conan profile detect --force | |
- name: Detect WebAssembly Conan Profile | |
if: matrix.config.name == 'WebAssembly' | |
run: | | |
cat > ~/.conan2/profiles/webassembly <<EOF | |
include(default) | |
[settings] | |
arch=wasm | |
os=Emscripten | |
[tool_requires] | |
*: emsdk/3.1.44 | |
EOF | |
- name: Install Ubuntu Dependencies | |
if: matrix.config.name == 'Ubuntu' | |
run: sudo apt-get install -y libegl-dev libegl1-mesa-dev libva-dev libvdpau-dev libx11-xcb-dev libfontenc-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxfixes-dev libxi-dev libxinerama-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxres-dev libxss-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev libxcb-dri3-dev libxcb-cursor-dev libxcb-util-dev | |
- name: Install Dependencies | |
if: matrix.config.name != 'WebAssembly' | |
run: conan install .. --output-folder=. --build=missing --settings compiler.cppstd=17 --settings build_type=Release | |
working-directory: build | |
- name: Install WebAssembly Dependencies | |
if: matrix.config.name == 'WebAssembly' | |
run: conan install .. --output-folder=. --build=missing --profile=webassembly --settings compiler.cppstd=17 --settings build_type=Release | |
working-directory: build | |
- name: Configure | |
run: cmake .. -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" -DCMAKE_BUILD_TYPE=Release | |
working-directory: build | |
- name: Build | |
run: cmake --build . --config Release --verbose | |
working-directory: build | |
- name: Create Artifacts Directory | |
run: mkdir artifacts | |
- name: Compress Artifacts | |
if: matrix.config.name == 'macOS' | |
working-directory: build | |
run: | | |
chmod -R a+rwx carimbo | |
tar -cpzvf macOS.tar.gz carimbo | |
mv macOS.tar.gz ../artifacts | |
- name: Compress Artifacts | |
if: matrix.config.name == 'Ubuntu' | |
working-directory: build | |
run: | | |
chmod +x carimbo | |
tar -czvf Ubuntu.tar.gz --mode='a+rwx' carimbo | |
mv Ubuntu.tar.gz ../artifacts | |
- name: Compress Artifacts | |
if: matrix.config.name == 'WebAssembly' | |
working-directory: build | |
run: | | |
zip -jr WebAssembly.zip carimbo.wasm carimbo.js | |
mv WebAssembly.zip ../artifacts | |
- name: Compress Artifacts | |
if: matrix.config.name == 'Windows' | |
working-directory: build | |
shell: powershell | |
run: | | |
Compress-Archive -LiteralPath 'Release/carimbo.exe' -DestinationPath "../artifacts/Windows.zip" | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ github.event.inputs.tagName }} | |
prerelease: ${{ github.events.inputs.prerelease }} | |
files: artifacts/* |