Update BuildMacOS.yml #4
This file contains hidden or 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 PicView Avalonia on macOS | |
on: | |
push: | |
branches: | |
- dev | |
pull_request: | |
branches: | |
- dev | |
jobs: | |
build: | |
runs-on: macos-latest | |
steps: | |
# Step 1: Checkout the code | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
# Step 2: Setup .NET 9 SDK | |
- name: Setup .NET 9 SDK | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '9.x' | |
# Step 3: Get version from Directory.Build.props using PowerShell | |
- name: Get version from Directory.Build.props | |
id: get-version | |
run: pwsh -File "${{ github.workspace }}/Build/Get-VersionInfo.ps1" | |
# Step 4 (x64): Publish arm64 version | |
- name: Build arm64 version | |
run: | | |
pwsh -File "${{ github.workspace }}\Build\Build Avalonia.MacOS.ps1" -Platform "arm64" -outputPath "${{ github.workspace }}\Build\PicView-v${{steps.get-version.outputs.version}}-osx-arm64" | |
shell: pwsh | |
# Step 5: Upload arm64 artifact | |
- name: Upload arm64 artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: PicView-v${{steps.get-version.outputs.version}}-macOS-arm64 | |
path: ${{ github.workspace }}/Build/PicView-v${{steps.get-version.outputs.version}}-macOS-arm64/ | |
retention-days: 14 | |
# Step 6: Build x64 version by modifying the platform parameter | |
- name: Build x64 version | |
run: | | |
pwsh -File "${{ github.workspace }}\Build\Build Avalonia.MacOS.ps1" -Platform "x64" -outputPath "${{ github.workspace }}\Build\PicView-v${{steps.get-version.outputs.version}}-osx-x64" | |
shell: pwsh | |
# Step 7: Upload x64 artifact | |
- name: Upload x64 artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: PicView-v${{steps.get-version.outputs.version}}-macOS-x64 | |
path: ${{ github.workspace }}/Build/PicView-v${{steps.get-version.outputs.version}}-macOS-x64/ | |
retention-days: 14 |