Skip to content

Mac: Fix some memory leaks #1209

Mac: Fix some memory leaks

Mac: Fix some memory leaks #1209

Workflow file for this run

name: Build
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
release:
types: [ published ]
env:
DotNetVersion: "7.0.116"
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@v3
with:
dotnet-version: ${{ env.DotNetVersion }}
- 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-14
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DotNetVersion }}
- name: Create global.json for the version we are using
run: del global.json || echo '{"sdk":{"version":"${{ env.DotNetVersion }}"}}' > global.json
- name: Install macos workload
run: sudo dotnet workload install macos --from-rollback-file dotnet-workloads.json
- name: Setup XCode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- 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 notarytool store-credentials "AC_PASSWORD" --apple-id "${{ secrets.AC_USERNAME }}" --team-id "${{ secrets.AC_TEAMID }}" --password "${{ 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.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.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'