Skip to content

Include raylib shell in natives #57

Include raylib shell in natives

Include raylib shell in natives #57

Workflow file for this run

name: Build Natives
on:
workflow_dispatch:
push:
branches:
- master
paths:
- lib/**
- src/Raylib.NET.Native/**
jobs:
natives:
strategy:
matrix:
# TODO: add linx-arm64, probs needs separate runner
runtime: [linux-x64, browser-wasm, osx-x64, osx-arm64, win-x64, win-x86, win-arm64]
config: [Debug, Release]
include:
- runtime: linux-x64
os: ubuntu-latest
- runtime: browser-wasm
os: ubuntu-latest
- runtime: osx-x64
os: macos-latest
- runtime: osx-arm64
os: macos-latest
- runtime: win-x64
os: windows-latest
- runtime: win-x86
os: windows-latest
- runtime: win-arm64
os: windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: true
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Setup Environment
if: matrix.os == 'ubuntu-latest'
shell: bash
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends \
gcc-multilib \
libgl1-mesa-dev \
libglfw3 \
libglfw3-dev \
libx11-dev \
libxcursor-dev \
libxrandr-dev \
libxinerama-dev \
libxi-dev \
libxext-dev \
libxfixes-dev \
libwayland-dev \
libxkbcommon-dev
- name: Setup EMSDK
if: matrix.runtime == 'browser-wasm'
uses: mymindstorm/setup-emsdk@v14
with:
actions-cache-folder: 'emsdk-cache'
- name: Build Natives
run: dotnet build -c ${{ matrix.config }} -r ${{ matrix.runtime }}
working-directory: src/Raylib.NET.Native
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: natives-${{ matrix.config }}-${{ matrix.runtime }}
path: src/Raylib.NET.Native/bin/${{ matrix.config }}/runtimes/**
if-no-files-found: error
upload-packages:
permissions:
packages: write
runs-on: ubuntu-latest
needs:
- natives
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Download Debug Artifacts
uses: actions/download-artifact@v4
with:
pattern: natives-Debug-*
path: src/Raylib.NET.Native/bin/Debug/runtimes
merge-multiple: true
- name: Download Release Artifacts
uses: actions/download-artifact@v4
with:
pattern: natives-Release-*
path: src/Raylib.NET.Native/bin/Release/runtimes
merge-multiple: true
- name: Generate NuGet Version
id: package-info
run: |
version="build.$(git rev-list --count HEAD)"
echo "version=$version" >> $GITHUB_OUTPUT
- name: Create NuGet Debug Packages
run: dotnet pack src/Raylib.NET.Native -c Debug --output nuget -p:SkipNatives=true -p:SkipGen=true -p:VersionSuffix=${{ steps.package-info.outputs.version }}
- name: Create NuGet Release Packages
run: dotnet pack src/Raylib.NET.Native -c Release --output nuget -p:SkipNatives=true -p:SkipGen=true -p:VersionSuffix=${{ steps.package-info.outputs.version }}
- name: Upload NuGet Packages As Artifacts
uses: actions/upload-artifact@v4
with:
name: nuget-packages
path: nuget/*
- name: Publish NuGet Packages to GitHub Packages
run: dotnet nuget push nuget/*.nupkg -s https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json -k ${{ secrets.GITHUB_TOKEN }} --skip-duplicate