Merge pull request #2478 from cwensley/curtis/wpf-brush-optimization-… #902
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: [ develop ] | |
pull_request: | |
branches: [ develop ] | |
release: | |
types: [ published ] | |
env: | |
DotNetVersion: "6.0.202" | |
BuildConfiguration: "Release" | |
BuildParameters: "build/Build.proj /v:Minimal /consoleLoggerParameters:NoSummary /p:Configuration=Release /p:BuildVersion=${{ github.run_id }} /p:BuildBranch=${{ github.ref }}" | |
jobs: | |
build-windows: | |
runs-on: windows-2022 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: ${{ env.DotNetVersion }} | |
- name: Setup msbuild | |
uses: microsoft/setup-msbuild@v1 | |
- name: Build | |
run: dotnet build ${{ env.BuildParameters }} /p:Platform=Windows /t:Build /bl:artifacts/log/Build.Windows.binlog | |
- name: Upload nuget artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: nuget | |
path: artifacts/nuget/${{ env.BuildConfiguration }}/*.nupkg | |
- name: Upload test artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: test | |
path: | | |
artifacts/test/*/${{ env.BuildConfiguration }}/**/* | |
!artifacts/test/Eto.Test.Mac64/**/* | |
- name: Upload sample artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: samples | |
path: artifacts/samples/*/${{ env.BuildConfiguration }}/**/* | |
- name: Upload log files | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: log | |
path: artifacts/log/**/* | |
build-mac: | |
runs-on: macos-11 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: ${{ env.DotNetVersion }} | |
- name: Install macos workload | |
run: sudo dotnet workload install macos | |
- name: Setup Xamarin and XCode | |
uses: maxim-lobanov/setup-xamarin@v1 | |
with: | |
mono-version: latest | |
xamarin-mac-version: latest | |
xcode-version: latest | |
- name: Import code signing certificate | |
if: github.event_name != 'pull_request' | |
uses: apple-actions/import-codesign-certs@v1 | |
with: | |
p12-file-base64: ${{ secrets.DEVID_CERTIFICATE_P12 }} | |
p12-password: ${{ secrets.DEVID_CERTIFICATE_P12_PASSWORD }} | |
- name: Enable code signing | |
if: github.event_name != 'pull_request' | |
run: echo "BuildParameters=${{ env.BuildParameters }} /p:EnableCodeSignBuild=True" >> $GITHUB_ENV | |
- name: Set notarization credentials | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
xcrun altool --store-password-in-keychain-item "AC_PASSWORD" -u "${{ secrets.AC_USERNAME }}" -p "${{ secrets.AC_PASSWORD }}" | |
echo "BuildParameters=${{ env.BuildParameters }} /p:EnableNotarizationBuild=True" >> $GITHUB_ENV | |
- name: Build | |
run: dotnet build ${{ env.BuildParameters }} /p:Platform=Mac /t:Build /bl:artifacts/log/Build.Mac.binlog | |
- name: Upload nuget artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: nuget | |
path: | | |
artifacts/nuget/${{ env.BuildConfiguration }}/Eto.Platform.XamMac2*.nupkg | |
artifacts/nuget/${{ env.BuildConfiguration }}/Eto.Platform.macOS*.nupkg | |
- name: Upload test artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: test | |
path: | | |
artifacts/test/Eto.Test.Mac64/${{ env.BuildConfiguration }}/**/Eto.Test.Mac64.dmg | |
artifacts/test/Eto.Test.XamMac2/${{ env.BuildConfiguration }}/**/Eto.Test.XamMac2.app | |
artifacts/test/Eto.Test.macOS/${{ env.BuildConfiguration }}/*/Eto.Test.macOS.app | |
- name: Upload log files | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: log | |
path: | | |
artifacts/log/**/* | |
lib/monomac/artifacts/generated/**/*.binlog | |
publish: | |
needs: [ build-windows, build-mac ] | |
runs-on: ubuntu-latest | |
if: (github.event_name == 'push' && github.ref == 'refs/heads/develop') || (github.event_name == 'release' && github.event.action == 'published' && startsWith(github.ref, 'refs/tags/')) | |
steps: | |
- name: Download nuget artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
name: nuget | |
- name: Push packages to myget.org | |
run: dotnet nuget push '*.nupkg' --skip-duplicate -s https://www.myget.org/F/eto/api/v2/package -k ${{secrets.MYGET_API_KEY}} | |
- name: Add nuget packages to release | |
uses: softprops/action-gh-release@v1 | |
if: (github.event_name == 'release' && github.event.action == 'published' && startsWith(github.ref, 'refs/tags/')) | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
files: '*.nupkg' |