Skip to content

Build and Release

Build and Release #3

Workflow file for this run

name: Build and Release
on:
workflow_dispatch:
inputs:
versionTag:
description: 'Version tag in release name'
required: false
type: string
default: 'v0.0.'
jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
include:
- os: windows-latest
suffix: win64
- os: ubuntu-latest
suffix: linux64
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install CMake
uses: lukka/get-cmake@latest
- name: Install LLVM/Clang
uses: KyleMayes/install-llvm-action@v2
with:
version: '17'
- name: Symlink libclang.so (Linux)
if: contains(matrix.os, 'ubuntu')
run: sudo ln -s libclang-11.so.1 /lib/x86_64-linux-gnu/libclang.so
working-directory: ${{ env.LLVM_PATH }}/lib
- name: Configure CMake
run: cmake -B build -DREFLECT_BUILD_EXAMPLE=OFF
- name: Build
run: cmake --build build
- name: Archive and upload artifacts
run: |
mkdir artifacts
find build/bin -type f -exec cp {} artifacts/{}_$(echo ${{ matrix.suffix }}) \;
shell: bash
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ inputs.versionTag }}
draft: false
prerelease: false
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifacts/
asset_name: ${{ matrix.os }}-artifacts.zip
asset_content_type: application/zip