mirror of
https://github.com/ivuorinen/hiha-arvio.git
synced 2026-01-26 03:14:00 +00:00
Change from -f flag to /p:TargetFramework MSBuild property in dotnet restore commands. **Problem**: - dotnet restore doesn't support -f or --framework flag - Using -f causes error: "MSB1008: Only one project can be specified" - MSBuild interprets "net8.0-maccatalyst" as a second project path **Solution**: Use MSBuild property syntax instead: - Before: dotnet restore src/HihaArvio/HihaArvio.csproj -f net8.0-ios - After: dotnet restore src/HihaArvio/HihaArvio.csproj /p:TargetFramework=net8.0-ios **Why This Works**: The /p:TargetFramework property tells restore to generate assets specifically for that target framework and its runtime identifiers. **Changes**: - build.yml: Use /p:TargetFramework for iOS and macOS restores - publish.yml: Use /p:TargetFramework for iOS and macOS restores **Verified Locally**: ✅ dotnet restore /p:TargetFramework=net8.0-maccatalyst - Success 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
91 lines
2.5 KiB
YAML
91 lines
2.5 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, develop ]
|
|
pull_request:
|
|
branches: [ main, develop ]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-ios:
|
|
name: Build iOS
|
|
runs-on: macos-14
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup .NET
|
|
uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: '8.0.x'
|
|
|
|
- name: Restore workloads
|
|
run: dotnet workload restore src/HihaArvio/HihaArvio.csproj
|
|
|
|
- name: Restore dependencies for iOS
|
|
run: dotnet restore src/HihaArvio/HihaArvio.csproj /p:TargetFramework=net8.0-ios
|
|
|
|
- name: Build iOS
|
|
run: dotnet build src/HihaArvio/HihaArvio.csproj -f net8.0-ios -c Release --no-restore /p:ArchiveOnBuild=false /p:EnableCodeSigning=false
|
|
|
|
- name: Upload iOS build artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ios-build
|
|
path: |
|
|
src/HihaArvio/bin/Release/net8.0-ios/**/*.app
|
|
src/HihaArvio/bin/Release/net8.0-ios/**/*.ipa
|
|
retention-days: 7
|
|
|
|
build-maccatalyst:
|
|
name: Build macOS Catalyst
|
|
runs-on: macos-14
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup .NET
|
|
uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: '8.0.x'
|
|
|
|
- name: Restore workloads
|
|
run: dotnet workload restore src/HihaArvio/HihaArvio.csproj
|
|
|
|
- name: Restore dependencies for macOS Catalyst
|
|
run: dotnet restore src/HihaArvio/HihaArvio.csproj /p:TargetFramework=net8.0-maccatalyst
|
|
|
|
- name: Build macOS Catalyst
|
|
run: dotnet build src/HihaArvio/HihaArvio.csproj -f net8.0-maccatalyst -c Release --no-restore /p:ArchiveOnBuild=false /p:EnableCodeSigning=false
|
|
|
|
- name: Upload macOS build artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: maccatalyst-build
|
|
path: |
|
|
src/HihaArvio/bin/Release/net8.0-maccatalyst/**/*.app
|
|
src/HihaArvio/bin/Release/net8.0-maccatalyst/**/*.pkg
|
|
retention-days: 7
|
|
|
|
build-status:
|
|
name: Build Status
|
|
runs-on: ubuntu-latest
|
|
needs: [build-ios, build-maccatalyst]
|
|
if: always()
|
|
|
|
steps:
|
|
- name: Check build status
|
|
run: |
|
|
if [[ "${{ needs.build-ios.result }}" == "success" ]] && [[ "${{ needs.build-maccatalyst.result }}" == "success" ]]; then
|
|
echo "✅ All builds succeeded"
|
|
exit 0
|
|
else
|
|
echo "❌ One or more builds failed"
|
|
echo "iOS: ${{ needs.build-ios.result }}"
|
|
echo "macOS Catalyst: ${{ needs.build-maccatalyst.result }}"
|
|
exit 1
|
|
fi
|