Attempt to fix CI builds #47
Workflow file for this run
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: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
release: | |
types: [ published ] | |
env: | |
BuildVersion: "CI.${{ github.run_id }}" | |
BuildBranch: "${{ github.ref }}" | |
BuildParameters: "-m:1 -c Release" | |
PackParameters: "--no-build --no-restore -m:1 -c Release" | |
DotNetVersion: '8.0.x' | |
jobs: | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ env.DotNetVersion }} | |
- name: Build | |
run: | | |
dotnet build ${{ env.BuildParameters }} test\TestEtoVeldrid.Wpf\TestEtoVeldrid.Wpf.csproj | |
dotnet build ${{ env.BuildParameters }} test\TestEtoVeldrid.WinForms\TestEtoVeldrid.WinForms.csproj | |
- name: Pack | |
run: | | |
dotnet pack ${{ env.PackParameters }} src\Eto.Veldrid.Wpf\Eto.Veldrid.Wpf.csproj | |
dotnet pack ${{ env.PackParameters }} src\Eto.Veldrid.WinForms\Eto.Veldrid.WinForms.csproj | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nuget | |
path: | | |
artifacts/nuget/**/Eto.Veldrid.Wpf.*.nupkg | |
artifacts/nuget/**/Eto.Veldrid.WinForms.*.nupkg | |
build-mac: | |
runs-on: macos-latest | |
env: | |
PlatformBuildParameters: /p:Platform=Mac Eto.Veldrid.sln | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ env.DotNetVersion }} | |
- name: Setup XCode | |
uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: latest-stable | |
- name: Install macos workload | |
run: dotnet workload install macos | |
- name: Build | |
run: dotnet build ${{ env.BuildParameters }} ${{ env.PlatformBuildParameters }} | |
- name: Pack | |
run: dotnet pack ${{ env.PackParameters }} ${{ env.PlatformBuildParameters }} | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nuget | |
path: artifacts/nuget/**/*.nupkg | |
publish: | |
needs: [ build-windows, build-mac ] | |
runs-on: ubuntu-latest | |
if: github.event_name == 'release' && github.event.action == 'published' | |
steps: | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ env.DotNetVersion }} | |
- name: Download NuGet Packages | |
uses: actions/download-artifact@v4 | |
with: | |
name: nuget | |
- name: Push packages | |
run: dotnet nuget push './nuget/**/*.nupkg' --skip-duplicate -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}} |