-
-
Notifications
You must be signed in to change notification settings - Fork 178
143 lines (121 loc) · 6.8 KB
/
Copy pathBuildMacOS.yml
File metadata and controls
143 lines (121 loc) · 6.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: Build PicView 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@v6
# Step 2: Setup .NET 11 SDK
- name: Setup .NET 11 SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: '11.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: Restore dependencies
- name: Restore dependencies
run: dotnet restore src/PicView.Avalonia.MacOS/PicView.Avalonia.MacOS.csproj
# Step 5: Build 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" `
-appVersion "${{steps.get-version.outputs.version}}"
shell: pwsh
# Add debug step to check the build output directories for arm64
- name: Debug - List build output directories for arm64
run: |
echo "Contents of build output directory:"
ls -la "${{ github.workspace }}/Build/PicView-v${{steps.get-version.outputs.version}}-osx-arm64"
echo "Contents of .app/Contents/MacOS:"
ls -la "${{ github.workspace }}/Build/PicView-v${{steps.get-version.outputs.version}}-osx-arm64/PicView.app/Contents/MacOS"
echo "Finding Magick.Native files in the repository:"
find "${{ github.workspace }}" -name "Magick.Native*arm64*.dylib" 2>/dev/null || echo "No Magick.Native arm64 dylib found"
# Add step to ensure Magick.Native libs are in the app bundle for arm64
- name: Copy Magick.Native libraries for arm64
run: |
# Find the Magick.Native dylibs
MAGICK_NATIVE_PATH=$(find "${{ github.workspace }}" -name "Magick.Native*arm64*.dylib" 2>/dev/null || echo "")
if [ ! -z "$MAGICK_NATIVE_PATH" ]; then
echo "Found Magick.Native dylib at: $MAGICK_NATIVE_PATH"
# Copy to the app's MacOS directory
cp "$MAGICK_NATIVE_PATH" "${{ github.workspace }}/Build/PicView-v${{steps.get-version.outputs.version}}-osx-arm64/PicView.app/Contents/MacOS/"
# Verify the copy
echo "After copying, MacOS directory contains:"
ls -la "${{ github.workspace }}/Build/PicView-v${{steps.get-version.outputs.version}}-osx-arm64/PicView.app/Contents/MacOS/"
else
echo "WARNING: Could not find Magick.Native-Q8-arm64.dylib file to copy"
echo "Checking in the nuget cache directory:"
find ~/.nuget -name "Magick.Native*arm64*.dylib" 2>/dev/null || echo "Not found in nuget cache"
fi
# Step 6: Create DMG for arm64
- name: Create DMG for arm64
run: |
hdiutil create -volname "PicView" -srcfolder "${{ github.workspace }}/Build/PicView-v${{steps.get-version.outputs.version}}-osx-arm64/PicView.app" -ov -format UDZO "${{ github.workspace }}/Build/PicView-v${{steps.get-version.outputs.version}}-osx-arm64.dmg"
# Step 7: Upload arm64 artifacts
- name: Upload arm64 artifacts
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}}-osx-arm64/PicView.app
${{ github.workspace }}/Build/PicView-v${{steps.get-version.outputs.version}}-osx-arm64.dmg
retention-days: 14
# Step 8: Build x64 version
- 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" `
-appVersion "${{steps.get-version.outputs.version}}"
shell: pwsh
# Add debug step to check the build output directories for x64
- name: Debug - List build output directories for x64
run: |
echo "Contents of build output directory:"
ls -la "${{ github.workspace }}/Build/PicView-v${{steps.get-version.outputs.version}}-osx-x64"
echo "Contents of .app/Contents/MacOS:"
ls -la "${{ github.workspace }}/Build/PicView-v${{steps.get-version.outputs.version}}-osx-x64/PicView.app/Contents/MacOS"
echo "Finding Magick.Native files in the repository:"
find "${{ github.workspace }}" -name "Magick.Native*x64*.dylib" 2>/dev/null || echo "No Magick.Native x64 dylib found"
# Add step to ensure Magick.Native libs are in the app bundle for x64
- name: Copy Magick.Native libraries for x64
run: |
# Find the Magick.Native dylibs
MAGICK_NATIVE_PATH=$(find "${{ github.workspace }}" -name "Magick.Native*x64*.dylib" 2>/dev/null || echo "")
if [ ! -z "$MAGICK_NATIVE_PATH" ]; then
echo "Found Magick.Native dylib at: $MAGICK_NATIVE_PATH"
# Copy to the app's MacOS directory
cp "$MAGICK_NATIVE_PATH" "${{ github.workspace }}/Build/PicView-v${{steps.get-version.outputs.version}}-osx-x64/PicView.app/Contents/MacOS/"
# Verify the copy
echo "After copying, MacOS directory contains:"
ls -la "${{ github.workspace }}/Build/PicView-v${{steps.get-version.outputs.version}}-osx-x64/PicView.app/Contents/MacOS/"
else
echo "WARNING: Could not find Magick.Native-Q8-x64.dylib file to copy"
echo "Checking in the nuget cache directory:"
find ~/.nuget -name "Magick.Native*x64*.dylib" 2>/dev/null || echo "Not found in nuget cache"
fi
# Step 9: Create DMG for x64
- name: Create DMG for x64
run: |
hdiutil create -volname "PicView" -srcfolder "${{ github.workspace }}/Build/PicView-v${{steps.get-version.outputs.version}}-osx-x64/PicView.app" -ov -format UDZO "${{ github.workspace }}/Build/PicView-v${{steps.get-version.outputs.version}}-osx-x64.dmg"
# Step 10: Upload x64 artifacts
- name: Upload x64 artifacts
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}}-osx-x64/PicView.app
${{ github.workspace }}/Build/PicView-v${{steps.get-version.outputs.version}}-osx-x64.dmg
retention-days: 14