Skip to content

Create Release

Create Release #23

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@v3
- 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
- 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@v3
with:
name: ${{ matrix.artifact-name }}
path: ${{github.workspace}}/build/RAYX-*-win64.zip
- name: Upload build artifact (Ubuntu)
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.artifact-name }}
path: ${{github.workspace}}/build/RAYX-*-Linux.deb
create-release:
needs: build-and-release
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
path: ${{github.workspace}}/artifacts
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
body: This will be updated soon...
draft: false
prerelease: false
- name: List downloaded artifacts and contents
run: |
ls -lah ${{github.workspace}}/artifacts
ls -lah ${{github.workspace}}/artifacts/rayx-Linux.deb
ls -lah ${{github.workspace}}/artifacts/rayx-win64.zip
- name: Upload Artifact to Release (Windows)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{github.workspace}}/artifacts/rayx-win64.zip/RAYX-0.18.0-win64.zip
asset_name: RAYX-0.18.0-win64.zip
asset_content_type: application/zip
- name: Upload Artifact to Release (Ubuntu)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{github.workspace}}/artifacts/rayx-Linux.deb/RAYX-0.18.0-Linux.deb
asset_name: RAYX-0.18.0-Linux.deb
asset_content_type: application/x-deb