Skip to content

Create Release

Create Release #30

Workflow file for this run

name: Create Release
on:
push:
tags:
- 'v*' # Triggers on tag push matching v*
jobs:
build-and-release:
name: Build and Release
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
artifact-name: rayx-win64.zip
build-type: Release
- os: ubuntu-latest
artifact-name: rayx-Linux.deb
build-type: Release
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Update all submodules
run: |
git submodule sync
git submodule update --init --recursive
# Prepare environment (Vulkan SDK, dependencies) based on OS
- name: Prepare environment
uses: humbletim/[email protected]
with:
vulkan-query-version: 1.3.275.0
vulkan-components: Vulkan-Headers, Vulkan-Loader, SPIRV-Tools, Glslang
vulkan-use-cache: true
- name: Install dependencies (Windows)
if: matrix.os == 'windows-latest'
run: |
vcpkg install hdf5 --triplet x64-windows
vcpkg integrate install
echo "$env:VCPKG_INSTALLATION_ROOT\installed\x64-windows\bin" >> $GITHUB_PATH
shell: powershell
- name: Install dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update --yes
sudo apt install --yes xorg-dev cmake libgtk-3-dev libdbus-1-dev libhdf5-dev
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DWERROR=YES -DCMAKE_BUILD_TYPE=${{ matrix.build-type }}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{ matrix.build-type }}
- name: Test
working-directory: ${{github.workspace}}/build/bin/release
run: ./rayx-core-tst -x
- name: CPack (Windows)
if: matrix.os == 'windows-latest'
working-directory: ${{github.workspace}}/build
run: cpack -G ZIP
- name: CPack (Ubuntu)
if: matrix.os == 'ubuntu-latest'
working-directory: ${{github.workspace}}/build
run: cpack -G DEB
- name: Upload build artifact (Windows)
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}
path: ${{github.workspace}}/build/RAYX-*-win64.zip
if-no-files-found: error
- name: Upload build artifact (Ubuntu)
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}
path: ${{github.workspace}}/build/RAYX-*-Linux.deb
if-no-files-found: error
release:
name: Create Release
needs: build-and-release
runs-on: ubuntu-latest
steps:
# Checkout CHANGELOG.md
- name: Checkout code
uses: actions/checkout@v4
with:
sparse-checkout: CHANGELOG.md
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: ${{github.workspace}}/artifacts
- name: Extract version from tag
id: get_version
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Create and Upload Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
body_path: ${{github.workspace}}/CHANGELOG.md
files: |
${{github.workspace}}/artifacts/rayx-win64.zip/*.zip
${{github.workspace}}/artifacts/rayx-Linux.deb/*.deb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}