Merge pull request #29 from picoe/focus_issue #44
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: "/v:Minimal /p:Configuration=Release Eto.Veldrid.sln" | |
jobs: | |
build-windows: | |
runs-on: windows-latest | |
env: | |
PlatformBuildParameters: /p:Platform=Windows | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '8.0.x' | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.nuget/packages | |
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-nuget- | |
- name: Install macos workload | |
run: dotnet workload install macos | |
- name: Build | |
run: dotnet build ${{ env.PlatformBuildParameters }} ${{ env.BuildParameters }} | |
- name: Pack | |
run: dotnet pack ${{ env.PlatformBuildParameters }} ${{ env.BuildParameters }} | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nuget | |
path: artifacts/nuget/**/*.nupkg | |
build-mac: | |
runs-on: macos-latest | |
env: | |
PlatformBuildParameters: /p:Platform=Mac | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '8.0.x' | |
- name: Setup XCode | |
uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: latest-stable | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.nuget/packages | |
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-nuget- | |
- name: Install macos workload | |
run: dotnet workload install macos | |
- name: Build | |
run: dotnet build ${{ env.PlatformBuildParameters }} ${{ env.BuildParameters }} | |
- name: Pack | |
run: dotnet pack ${{ env.PlatformBuildParameters }} ${{ env.BuildParameters }} | |
# - name: Upload artifacts | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: nuget | |
# path: artifacts/nuget/**/Eto.Veldrid.XamMac2.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 | |
- 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}} |