Skip to content

Changelog, release dates and visualisation tag for v2.0.0-rc.1 release #34

Changelog, release dates and visualisation tag for v2.0.0-rc.1 release

Changelog, release dates and visualisation tag for v2.0.0-rc.1 release #34

Workflow file for this run

# Perform thorough builds, and potentially create a draft CI workflow.
name: Draft Release
on:
# Trigger on pushes to matching tags.
push:
tags:
- 'v*.*.*'
# Or on pull_requests which mutate this CI workflow, using pr rather than push:branch to ensure that the merged state will be OK, as that is what is important here.
pull_request:
paths:
- ".github/workflows/Draft-Release.yml"
# Or trigger on manual dispatch. This will not produce a release, but will perform the thorough build.
workflow_dispatch:
defaults:
run:
# Default to using bash regardless of OS unless otherwise specified.
shell: bash
# @todo - add a job/step which validates the version is of the correct format (for pre releases) and that the git tag matches the CMake/header version(s)
# Several jobs with some dependencies between them.
# + Thorough Ubuntu builds
# + Oldest and newest cuda, lots of arch, vis off, tests on
# + Thorough Windows builds
# + Oldest and newest cuda, lots of arch, vis off, tests on
# + Wheel producing manylinux builds
# + CUDA 11.2 and 12.0, py 3.8-3.12, vis on/off, py only.
# + Wheel producing Windows builds
# + CUDA 11.2 and 12.0, py 3.8-3.12, vis on/off, py only.
# + Draft github release workflow.
jobs:
build-ubuntu:
runs-on: ${{ matrix.cudacxx.os }}
strategy:
fail-fast: false
# Multiplicative build matrix
# optional exclude: can be partial, include: must be specific
matrix:
# CUDA_ARCH values are reduced compared to wheels due to CI memory issues while compiling the test suite.
cudacxx:
- cuda: "12.0"
cuda_arch: "50-real;90-real;90-virtual;"
hostcxx: gcc-11
os: ubuntu-22.04
- cuda: "11.8"
cuda_arch: "35-real;90-real;90-virtual"
hostcxx: gcc-9
os: ubuntu-20.04
- cuda: "11.0"
cuda_arch: "35-real;80-real;80-virtual"
hostcxx: gcc-8
os: ubuntu-20.04
python:
- "3.8"
config:
- name: "Release"
config: "Release"
SEATBELTS: "ON"
VISUALISATION:
- "OFF"
# Name the job based on matrix/env options
name: "build-ubuntu (${{ matrix.cudacxx.cuda }}, ${{matrix.python}}, ${{ matrix.VISUALISATION }}, ${{ matrix.config.name }}, ${{ matrix.cudacxx.os }})"
# Define job-wide env constants, and promote matrix elements to env constants for portable steps.
env:
# Define constants
BUILD_DIR: "build"
FLAMEGPU_BUILD_TESTS: "ON"
# Conditional based on matrix via awkward almost ternary
FLAMEGPU_BUILD_PYTHON: ${{ fromJSON('{true:"ON",false:"OFF"}')[matrix.python != ''] }}
# Port matrix options to environment, for more portability.
CUDA: ${{ matrix.cudacxx.cuda }}
CUDA_ARCH: ${{ matrix.cudacxx.cuda_arch }}
HOSTCXX: ${{ matrix.cudacxx.hostcxx }}
OS: ${{ matrix.cudacxx.os }}
CONFIG: ${{ matrix.config.config }}
FLAMEGPU_SEATBELTS: ${{ matrix.config.SEATBELTS }}
PYTHON: ${{ matrix.python}}
VISUALISATION: ${{ matrix.VISUALISATION }}
steps:
- uses: actions/checkout@v3
- name: Install CUDA
if: ${{ startswith(env.OS, 'ubuntu') && env.CUDA != '' }}
env:
cuda: ${{ env.CUDA }}
run: .github/scripts/install_cuda_ubuntu.sh
- name: Install/Select gcc and g++
if: ${{ startsWith(env.HOSTCXX, 'gcc-') }}
run: |
gcc_version=${HOSTCXX//gcc-/}
sudo apt-get install -y gcc-${gcc_version} g++-${gcc_version}
echo "CC=/usr/bin/gcc-${gcc_version}" >> $GITHUB_ENV
echo "CXX=/usr/bin/g++-${gcc_version}" >> $GITHUB_ENV
echo "CUDAHOSTCXX=/usr/bin/g++-${gcc_version}" >> $GITHUB_ENV
- name: Select Python
if: ${{ env.PYTHON != '' && env.FLAMEGPU_BUILD_PYTHON == 'ON' }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON }}
- name: Install python dependencies
if: ${{ env.PYTHON != '' && env.FLAMEGPU_BUILD_PYTHON == 'ON' }}
run: |
sudo apt-get install python3-venv
python3 -m pip install --upgrade wheel build setuptools
- name: Install Visualisation Dependencies
if: ${{ startswith(env.OS, 'ubuntu') && env.VISUALISATION == 'ON' }}
run: |
# Install ubuntu-20.04 packages
if [ "$OS" == 'ubuntu-20.04' ]; then
sudo apt-get install -y libglew-dev libfontconfig1-dev libsdl2-dev libdevil-dev libfreetype-dev
fi
# Install Ubuntu 18.04 packages
if [ "$OS" == 'ubuntu-18.04' ]; then
sudo apt-get install -y libglew-dev libfontconfig1-dev libsdl2-dev libdevil-dev libfreetype6-dev libgl1-mesa-dev
fi
- name: Install Swig >= 4.0.2
run: |
# Remove existing swig install, so CMake finds the correct swig
if [ "$OS" == 'ubuntu-20.04' ]; then
sudo apt-get remove -y swig swig4.0
fi
# Install Ubuntu 18.04 packages
if [ "$OS" == 'ubuntu-18.04' ]; then
sudo apt-get remove -y swig
fi
# Install additional apt-based dependencies required to build swig 4.0.2
sudo apt-get install -y bison
# Create a local directory to build swig in.
mkdir -p swig-from-source && cd swig-from-source
# Install SWIG building from source dependencies
wget https://github.com/swig/swig/archive/refs/tags/v4.0.2.tar.gz
tar -zxf v4.0.2.tar.gz
cd swig-4.0.2/
./autogen.sh
./configure
make
sudo make install
# This pre-emptively patches a bug where ManyLinux didn't generate buildnumber as git dir was owned by diff user
- name: Enable git safe-directory
run: git config --global --add safe.directory $GITHUB_WORKSPACE
- name: Configure cmake
run: >
cmake . -B "${{ env.BUILD_DIR }}"
-DCMAKE_BUILD_TYPE="${{ env.CONFIG }}"
-Werror=dev
-DCMAKE_WARN_DEPRECATED="OFF"
-DFLAMEGPU_WARNINGS_AS_ERRORS="ON"
-DCMAKE_CUDA_ARCHITECTURES="${{ env.CUDA_ARCH }}"
-DFLAMEGPU_BUILD_TESTS="${{ env.FLAMEGPU_BUILD_TESTS }}"
-DFLAMEGPU_BUILD_PYTHON="${{ env.FLAMEGPU_BUILD_PYTHON }}"
-DPYTHON3_EXACT_VERSION="${{ env.PYTHON }}"
-DFLAMEGPU_VISUALISATION="${{ env.VISUALISATION }}"
-DFLAMEGPU_ENABLE_NVTX="ON"
- name: Build static library
working-directory: ${{ env.BUILD_DIR }}
run: cmake --build . --target flamegpu --verbose -j `nproc`
- name: Build python wheel
if: ${{ env.FLAMEGPU_BUILD_PYTHON == 'ON' }}
working-directory: ${{ env.BUILD_DIR }}
run: cmake --build . --target pyflamegpu --verbose -j `nproc`
- name: Build tests
if: ${{ env.FLAMEGPU_BUILD_TESTS == 'ON' }}
working-directory: ${{ env.BUILD_DIR }}
run: cmake --build . --target tests --verbose -j `nproc`
- name: Build all remaining targets
working-directory: ${{ env.BUILD_DIR }}
run: cmake --build . --target all --verbose -j `nproc`
# Thorough Windows builds
build-windows:
runs-on: ${{ matrix.cudacxx.os }}
strategy:
fail-fast: false
# Multiplicative build matrix
# optional exclude: can be partial, include: must be specific
matrix:
# CUDA_ARCH values are reduced compared to wheels due to CI memory issues while compiling the test suite.
cudacxx:
- cuda: "12.0.0"
cuda_arch: "50-real;90-real;90-virtual"
hostcxx: "Visual Studio 17 2022"
os: windows-2022
- cuda: "11.8.0"
cuda_arch: "35-real;90-real;90-virtual"
hostcxx: "Visual Studio 16 2019"
os: windows-2019
- cuda: "11.0.3"
cuda_arch: "35-real;80-real;80-virtual"
hostcxx: "Visual Studio 16 2019"
os: windows-2019
python:
- "3.8"
config:
- name: "Release"
config: "Release"
SEATBELTS: "ON"
VISUALISATION:
- "OFF"
# Name the job based on matrix/env options
name: "build-windows (${{ matrix.cudacxx.cuda }}, ${{matrix.python}}, ${{ matrix.VISUALISATION }}, ${{ matrix.config.name }}, ${{ matrix.cudacxx.os }})"
# Define job-wide env constants, and promote matrix elements to env constants for portable steps.
env:
# Define constants
BUILD_DIR: "build"
FLAMEGPU_BUILD_TESTS: "ON"
# Conditional based on matrix via awkward almost ternary
FLAMEGPU_BUILD_PYTHON: ${{ fromJSON('{true:"ON",false:"OFF"}')[matrix.python != ''] }}
# Port matrix options to environment, for more portability.
CUDA: ${{ matrix.cudacxx.cuda }}
CUDA_ARCH: ${{ matrix.cudacxx.cuda_arch }}
HOSTCXX: ${{ matrix.cudacxx.hostcxx }}
OS: ${{ matrix.cudacxx.os }}
CONFIG: ${{ matrix.config.config }}
FLAMEGPU_SEATBELTS: ${{ matrix.config.SEATBELTS }}
PYTHON: ${{ matrix.python}}
VISUALISATION: ${{ matrix.VISUALISATION }}
steps:
- uses: actions/checkout@v3
- name: Install CUDA (Windows)
if: ${{ runner.os == 'Windows' && env.CUDA != '' }}
shell: powershell
env:
cuda: ${{ env.CUDA }}
visual_studio: ${{ env.HOSTCXX }}
run: .github\scripts\install_cuda_windows.ps1
- name: Select Python
if: ${{ env.PYTHON != '' && env.FLAMEGPU_BUILD_PYTHON == 'ON' }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON }}
- name: Install python dependencies
if: ${{ env.PYTHON != '' && env.FLAMEGPU_BUILD_PYTHON == 'ON' }}
run: |
python3 -m pip install --upgrade wheel build setuptools
- name: Add custom problem matchers for annotations
run: echo "::add-matcher::.github/problem-matchers.json"
# This pre-emptively patches a bug where ManyLinux didn't generate buildnumber as git dir was owned by diff user
- name: Enable git safe-directory
run: git config --global --add safe.directory $GITHUB_WORKSPACE
# Must pass -G -A for windows, and -DPython3_ROOT_DIR/-DPYTHON3_EXECUTABLE as a github action workaround
- name: Configure cmake
run: >
cmake . -B "${{ env.BUILD_DIR }}"
-G "${{ env.HOSTCXX }}" -A x64
-Werror=dev
-DCMAKE_WARN_DEPRECATED="OFF"
-DFLAMEGPU_WARNINGS_AS_ERRORS="ON"
-DCMAKE_CUDA_ARCHITECTURES="${{ env.CUDA_ARCH }}"
-DFLAMEGPU_BUILD_TESTS="${{ env.FLAMEGPU_BUILD_TESTS }}"
-DFLAMEGPU_BUILD_PYTHON="${{ env.FLAMEGPU_BUILD_PYTHON }}"
-DPython3_ROOT_DIR="$(dirname $(which python))"
-DPython3_EXECUTABLE="$(which python)"
-DFLAMEGPU_VISUALISATION="${{ env.VISUALISATION }}"
-DFLAMEGPU_ENABLE_NVTX="ON"
- name: Build static library
working-directory: ${{ env.BUILD_DIR }}
run: cmake --build . --config ${{ env.CONFIG }} --target flamegpu --verbose -j `nproc`
- name: Build python wheel
if: ${{ env.FLAMEGPU_BUILD_PYTHON == 'ON' }}
working-directory: ${{ env.BUILD_DIR }}
run: cmake --build . --config ${{ env.CONFIG }} --target pyflamegpu --verbose -j `nproc`
- name: Build tests
if: ${{ env.FLAMEGPU_BUILD_TESTS == 'ON' }}
working-directory: ${{ env.BUILD_DIR }}
run: cmake --build . --config ${{ env.CONFIG }} --target tests --verbose -j `nproc`
- name: Build all remaining targets
working-directory: ${{ env.BUILD_DIR }}
run: cmake --build . --config ${{ env.CONFIG }} --target ALL_BUILD --verbose -j `nproc`
# Manylinux2014 Wheel builds, using the manylinux2014 container
wheel-manylinux2014:
runs-on: ${{ matrix.cudacxx.os }}
# Run steps inside a manylinux container.
container: quay.io/pypa/manylinux2014_x86_64
strategy:
fail-fast: false
# Multiplicative build matrix
# optional exclude: can be partial, include: must be specific
matrix:
cudacxx:
- cuda: "12.0"
cuda_arch: "50-real;60-real;70-real;80-real;90-real;90-virtual"
hostcxx: devtoolset-10
os: ubuntu-20.04
- cuda: "11.2"
cuda_arch: "35-real;50-real;60-real;70-real;80-real;80-virtual"
hostcxx: devtoolset-9
os: ubuntu-20.04
python:
- "3.12"
- "3.11"
- "3.10"
- "3.9"
- "3.8"
config:
- name: "Release"
config: "Release"
SEATBELTS: "ON"
VISUALISATION:
- "ON"
- "OFF"
# Name the job based on matrix/env options
name: "wheel-manylinux2014 (${{ matrix.cudacxx.cuda }}, ${{matrix.python}}, ${{ matrix.VISUALISATION }}, ${{ matrix.config.name }}, ${{ matrix.cudacxx.os }})"
env:
# Control if the wheel should be repaired. This will fail until .so's are addressed
AUDITWHEEL_REPAIR: "OFF"
MANYLINUX: "manylinux2014"
ARCH: "x86_64"
# Control if static GLEW should be built and used or not.
USE_STATIC_GLEW: "ON"
# Compute the wheelhouse name which should be unique within the matrix. This must be unique per build matrix/job combination
ARTIFACT_NAME: wheel-manylinux2014-${{ matrix.cudacxx.cuda }}-${{matrix.python}}-${{ matrix.VISUALISATION }}-${{ matrix.config.name }}-${{ matrix.cudacxx.os }}
# Define constants
BUILD_DIR: "build"
FLAMEGPU_BUILD_TESTS: "OFF"
# Conditional based on matrix via awkward almost ternary
FLAMEGPU_BUILD_PYTHON: ${{ fromJSON('{true:"ON",false:"OFF"}')[matrix.python != ''] }}
# Port matrix options to environment, for more portability.
CUDA: ${{ matrix.cudacxx.cuda }}
CUDA_ARCH: ${{ matrix.cudacxx.cuda_arch }}
HOSTCXX: ${{ matrix.cudacxx.hostcxx }}
OS: ${{ matrix.cudacxx.os }}
CONFIG: ${{ matrix.config.config }}
FLAMEGPU_SEATBELTS: ${{ matrix.config.SEATBELTS }}
PYTHON: ${{ matrix.python}}
VISUALISATION: ${{ matrix.VISUALISATION }}
steps:
- uses: actions/checkout@v3
# Downgrade the devtoolset in the image based on the build matrix, using:
# gcc-10 for CUDA >= 11.2. Unclear if devtoolset-10 will upgrade to unpatched 11.3 which breaks CUDA builds that use <chrono>.
# gcc-9 for CUDA >= 11.0
# these are not the officially supported toolset on centos by cuda, but it's what works.
- name: Install RHEL devtoolset (CentOS)
if: ${{ startsWith(env.HOSTCXX, 'devtoolset-') }}
run: |
# Install devtoolset-X
yum install -y ${{ env.HOSTCXX }}
# Enable the toolset via source not scl enable which doesn't get on with multi-step GHA
source /opt/rh/${{ env.HOSTCXX }}/enable
# Export the new environment / compilers for subsequent steps.
echo "PATH=${PATH}" >> $GITHUB_ENV
echo "CC=$(which gcc)" >> $GITHUB_ENV
echo "CXX=$(which g++)" >> $GITHUB_ENV
echo "CUDAHOSTCXX=$(which g++)" >> $GITHUB_ENV
- name: Install CUDA (CentOS)
if: ${{ env.CUDA != '' }}
env:
cuda: ${{ env.CUDA }}
run: .github/scripts/install_cuda_centos.sh
- name: Install Visualisation Dependencies (CentOS)
if: ${{ env.VISUALISATION == 'ON' }}
run: |
yum install -y glew-devel fontconfig-devel SDL2-devel freetype-devel
# Build/Install DevIL from source.
yum install -y freeglut-devel
git clone --depth 1 https://github.com/DentonW/DevIL.git
cd DevIL/DevIL
mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=${{ env.CONFIG }} -Wno-error=dev
make -j `nproc`
make install
- name: Build and install GLEW including static GLEW
if: ${{ env.VISUALISATION == 'ON' && env.USE_STATIC_GLEW == 'ON' }}
env:
GLEW_VERSION: "2.2.0"
run: |
yum install -y wget
wget https://github.com/nigels-com/glew/releases/download/glew-${{ env.GLEW_VERSION }}/glew-${{ env.GLEW_VERSION }}.tgz
tar -zxf glew-${{ env.GLEW_VERSION }}.tgz
cd glew-${{ env.GLEW_VERSION }}
make
make install
# This patches a bug where ManyLinux doesn't generate buildnumber as git dir is owned by diff user
- name: Enable git safe-directory
run: git config --global --add safe.directory $GITHUB_WORKSPACE
# Unlike other builds manylinux, uses static glew as it has been built and installed.
- name: Configure cmake
run: >
cmake . -B "${{ env.BUILD_DIR }}"
-DCMAKE_BUILD_TYPE="${{ env.CONFIG }}"
-Werror=dev
-DCMAKE_WARN_DEPRECATED="OFF"
-DFLAMEGPU_WARNINGS_AS_ERRORS="ON"
-DCMAKE_CUDA_ARCHITECTURES="${{ env.CUDA_ARCH }}"
-DFLAMEGPU_BUILD_TESTS="${{ env.FLAMEGPU_BUILD_TESTS }}"
-DFLAMEGPU_BUILD_PYTHON="${{ env.FLAMEGPU_BUILD_PYTHON }}"
-DPYTHON3_EXACT_VERSION="${{ env.PYTHON }}"
-DFLAMEGPU_VISUALISATION="${{ env.VISUALISATION }}"
-DFLAMEGPU_ENABLE_NVTX="ON"
-DGLEW_USE_STATIC_LIBS="${{ env.USE_STATIC_GLEW }}"
-DOpenGL_GL_PREFERENCE:STRING=LEGACY
- name: Build python wheel
if: ${{ env.FLAMEGPU_BUILD_PYTHON == 'ON' }}
working-directory: ${{ env.BUILD_DIR }}
run: cmake --build . --target pyflamegpu --verbose -j `nproc`
# Run audithweel show for information, but do not repair.
- name: Run auditwheel show
working-directory: ${{ env.BUILD_DIR }}
run: auditwheel show lib/${{ env.CONFIG }}/python/dist/*whl
# Ideally we should use auditwheel repair to check/enforce conformity
# But we cannot due to cuda shared object (libcuda.so.1) dependencies which we cannot/shouldnot/wil not package into the wheel.
- name: Run auditwheel repair
if: ${{ env.AUDITWHEEL_REPAIR == 'ON' }}
working-directory: ${{ env.BUILD_DIR }}
run: auditwheel repair --plat ${{ env.MANYLINUX }}_${{ env.ARCH }} lib/${{ env.CONFIG }}/python/dist/*whl -w lib/${{ env.CONFIG }}/python/dist
# Upload wheel artifacts to the job on GHA, with a short retention
# Use a unique name per job matrix run, to avoid a risk of corruption according to the docs (although it should work with unique filenames)
- name: Upload Wheel Artifacts
if: ${{ env.FLAMEGPU_BUILD_PYTHON == 'ON' }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.BUILD_DIR }}/lib/${{ env.CONFIG }}/python/dist/*.whl
if-no-files-found: error
retention-days: 7
# Windows Wheel builds
wheel-windows:
runs-on: ${{ matrix.cudacxx.os }}
strategy:
fail-fast: false
# Multiplicative build matrix
# optional exclude: can be partial, include: must be specific
matrix:
cudacxx:
- cuda: "12.0.0"
cuda_arch: "50-real;60-real;70-real;80-real;90-real;90-virtual"
hostcxx: "Visual Studio 16 2019"
os: windows-2019
- cuda: "11.2.2"
cuda_arch: "35-real;50-real;60-real;70-real;80-real;80-virtual"
hostcxx: "Visual Studio 16 2019"
os: windows-2019
python:
- "3.12"
- "3.11"
- "3.10"
- "3.9"
- "3.8"
config:
- name: "Release"
config: "Release"
SEATBELTS: "ON"
VISUALISATION:
- "ON"
- "OFF"
# Name the job based on matrix/env options
name: "wheel-windows (${{ matrix.cudacxx.cuda }}, ${{matrix.python}}, ${{ matrix.VISUALISATION }}, ${{ matrix.config.name }}, ${{ matrix.cudacxx.os }})"
# Define job-wide env constants, and promote matrix elements to env constants for portable steps.
env:
# Compute the wheelhouse name which should be unique within the matrix. This must be unique per build matrix/job combination
ARTIFACT_NAME: wheel-windows-${{ matrix.cudacxx.cuda }}-${{matrix.python}}-${{ matrix.VISUALISATION }}-${{ matrix.config.name }}-${{ matrix.cudacxx.os }}
# Define constants
BUILD_DIR: "build"
FLAMEGPU_BUILD_TESTS: "OFF"
# Conditional based on matrix via awkward almost ternary
FLAMEGPU_BUILD_PYTHON: ${{ fromJSON('{true:"ON",false:"OFF"}')[matrix.python != ''] }}
# Port matrix options to environment, for more portability.
CUDA: ${{ matrix.cudacxx.cuda }}
CUDA_ARCH: ${{ matrix.cudacxx.cuda_arch }}
HOSTCXX: ${{ matrix.cudacxx.hostcxx }}
OS: ${{ matrix.cudacxx.os }}
CONFIG: ${{ matrix.config.config }}
FLAMEGPU_SEATBELTS: ${{ matrix.config.SEATBELTS }}
PYTHON: ${{ matrix.python}}
VISUALISATION: ${{ matrix.VISUALISATION }}
steps:
- uses: actions/checkout@v3
- name: Install CUDA (Windows)
if: ${{ runner.os == 'Windows' && env.CUDA != '' }}
shell: powershell
env:
cuda: ${{ env.CUDA }}
visual_studio: ${{ env.HOSTCXX }}
run: .github\scripts\install_cuda_windows.ps1
- name: Select Python
if: ${{ env.PYTHON != '' && env.FLAMEGPU_BUILD_PYTHON == 'ON' }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON }}
- name: Install python dependencies
if: ${{ env.PYTHON != '' && env.FLAMEGPU_BUILD_PYTHON == 'ON' }}
run: |
python3 -m pip install --upgrade wheel build setuptools
- name: Add custom problem matchers for annotations
run: echo "::add-matcher::.github/problem-matchers.json"
# This pre-emptively patches a bug where ManyLinux didn't generate buildnumber as git dir was owned by diff user
- name: Enable git safe-directory
run: git config --global --add safe.directory $GITHUB_WORKSPACE
# Must pass -G -A for windows, and -DPython3_ROOT_DIR/-DPYTHON3_EXECUTABLE as a github action workaround
- name: Configure cmake
run: >
cmake . -B "${{ env.BUILD_DIR }}"
-G "${{ env.HOSTCXX }}" -A x64
-Werror=dev
-DCMAKE_WARN_DEPRECATED="OFF"
-DFLAMEGPU_WARNINGS_AS_ERRORS="ON"
-DCMAKE_CUDA_ARCHITECTURES="${{ env.CUDA_ARCH }}"
-DFLAMEGPU_BUILD_TESTS="${{ env.FLAMEGPU_BUILD_TESTS }}"
-DFLAMEGPU_BUILD_PYTHON="${{ env.FLAMEGPU_BUILD_PYTHON }}"
-DPython3_ROOT_DIR="$(dirname $(which python))"
-DPython3_EXECUTABLE="$(which python)"
-DFLAMEGPU_VISUALISATION="${{ env.VISUALISATION }}"
-DFLAMEGPU_ENABLE_NVTX="ON"
- name: Build python wheel
if: ${{ env.FLAMEGPU_BUILD_PYTHON == 'ON' }}
working-directory: ${{ env.BUILD_DIR }}
run: cmake --build . --config ${{ env.CONFIG }} --target pyflamegpu --verbose -j `nproc`
# Upload wheel artifacts to the job on GHA, with a short retention
# Use a unique name per job matrix run, to avoid a risk of corruption according to the docs (although it should work with unique filenames)
- name: Upload Wheel Artifacts
if: ${{env.FLAMEGPU_BUILD_PYTHON == 'ON' }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.BUILD_DIR }}/lib/${{ env.CONFIG }}/python/dist/*.whl
if-no-files-found: error
retention-days: 7
# Create a draft release, if all other jobs are successful and if the workflow was triggered by a version tag push event.
create-draft-release:
needs:
- build-ubuntu
- build-windows
- wheel-manylinux2014
- wheel-windows
if: ${{ success() && startsWith(github.ref, 'refs/tags/v') && github.event_name != 'workflow_dispatch' && github.event_name != 'pull_request' }}
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
# Download python wheels from previous jobs.
- name: Download Wheel Artifacts
id: download
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Find Wheel Artifacts
id: find_wheels
run: |
# Find files, storing in the files variable
pattern="${{ steps.download.outputs.download-path }}/*/*.whl"
files=""
for f in ${pattern}; do
# @future - Set human readable display label
label="$(basename ${f})"
files="${files} \"${f}#${label}\""
done
echo "files: ${files}"
# Set the list of files as the output for this step
echo "files=${files}" >> "$GITHUB_OUTPUT"
# Extract information from the tag which is required for the draft github release
- name: Process Tag
id: tag
run: |
ref=${{ github.ref }}
tag=${ref/refs\/tags\//}
version=${tag/v/}
prerelease_label=$(echo ${tag} | cut -d- -f2)
prerelease_label_len=$(echo ${prerelease_label} | wc -c)
prerelease_flag=$([[ -z "${prerelease_label_len}" ]] && echo "" || echo "--prerelease")
# set step outputs
echo "tag=${tag}" >> "$GITHUB_OUTPUT"
echo "version=${version}" >> "$GITHUB_OUTPUT"
echo "prerelease_flag=${prerelease_flag}" >> "$GITHUB_OUTPUT"
# Use the gh cli tool to create a draft release
# @future - use --notes "notes string" or --notes-file file
- name: Create Draft Release
id: create_release
run: gh release create --draft ${{ env.PRERELEASE_FLAG}} --title "${{ env.TITLE }}" ${{ env.TAG }} ${{ env.FILES }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PRERELEASE_FLAG: "${{ steps.tag.outputs.prerelease_flag }}"
TAG: "${{ steps.tag.outputs.tag }}"
TITLE: "FLAME GPU ${{ steps.tag.outputs.version }}"
FILES: ${{ steps.find_wheels.outputs.files }}