Try to cleanup build.zig a bit #200
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
jobs: | |
build-and-update: | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
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: Build | |
run: dotnet build -c Release -p:SkipNatives=true | |
- name: Test | |
run: dotnet test -p:SkipNatives=true -p:SkipGen=true | |
- name: Push Changes | |
run: | | |
git config --global user.name github-actions | |
git config --global user.email [email protected] | |
if [ -n "$(git status --porcelain)" ]; then | |
git add . | |
git commit -m "Update bindings [ci skip]" | |
git push | |
else | |
echo "No changes to commit" | |
fi | |
upload-packages: | |
permissions: | |
packages: write | |
runs-on: ubuntu-latest | |
needs: | |
- build-and-update | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Setup .NET 8 | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Generate NuGet Version | |
id: package-info | |
run: | | |
version="build.$(git rev-list --count HEAD)" | |
echo "version=$version" >> $GITHUB_OUTPUT | |
- name: Create NuGet Packages | |
run: | | |
dotnet pack -c Release --output nuget -p:SkipNatives=true -p:SkipGen=true -p:VersionSuffix=${{ steps.package-info.outputs.version }} | |
rm -rf nuget/Raylib.NET.Native* | |
- 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 |