forked from warexify/directhw
-
Notifications
You must be signed in to change notification settings - Fork 5
151 lines (133 loc) · 5.81 KB
/
objective-c-xcode.yml
File metadata and controls
151 lines (133 loc) · 5.81 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
144
145
146
147
148
149
150
151
name: Xcode - Build and Analyze (10.6+ target)
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
jobs:
build:
name: Build and analyse default scheme using xcodebuild command
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Xcodebuild (Unsigned for CI)
working-directory: ./DirectHW
run: |
# Build without signing for CI/CD - users can sign locally if needed
xcodebuild -alltargets -project DirectHW.xcodeproj \
CODE_SIGN_IDENTITY="" \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGNING_ALLOWED=NO
- name: libs
working-directory: ./DirectHW
run: make libs
- name: Create Package
working-directory: ./DirectHW
run: |
# Create unsigned package for CI/CD distribution
# Note: For production use, kext requires valid developer signature
# Users should re-sign with their certificates: codesign --force --sign "Developer ID" DirectHW.kext
# Find the actual build directory
BUILD_ROOT=""
for BUILD_DIR in "build/buildlatest/Release" "build/Release" "build/*/Release"; do
if [ -d "./$BUILD_DIR" ]; then
BUILD_ROOT="./$BUILD_DIR"
echo "Found build directory: $BUILD_ROOT"
break
fi
done
if [ -n "$BUILD_ROOT" ] && command -v pkgbuild >/dev/null 2>&1; then
pkgbuild --root "$BUILD_ROOT" \
--identifier com.directhw \
--version 1.0 \
--scripts . \
DirectHW.pkg || echo "Package creation with pkgbuild failed, continuing..."
elif [ -d "DirectHW.pmdoc" ]; then
packagemaker --doc DirectHW.pmdoc --id com.directhw --out DirectHW.pkg || echo "Package creation with packagemaker failed, continuing..."
else
echo "No package creation method available or no build directory found, skipping..."
fi
- name: Build Universal AppleScript Runner
run: |
# Build universal AppleScript runner for create-dmg (preserves PowerPC original)
cd create-dmg/support
make clean
make
# Save as universal binary (keeping PowerPC original intact)
cp AdiumApplescriptRunner AdiumApplescriptRunner-Universal
git restore AdiumApplescriptRunner # Restore PowerPC original
file AdiumApplescriptRunner AdiumApplescriptRunner-Universal
echo "Built universal AppleScript runner alongside PowerPC original"
- name: Create DMG
run: |
# Prepare DMG contents
mkdir -p dmg_contents
# Check what was actually built
echo "=== Build directory contents ==="
find DirectHW -name "build*" -type d -exec ls -la {} \; 2>/dev/null || echo "No build directory found"
find DirectHW -name "*.kext" -o -name "*.framework" -o -name "*.dylib" -o -name "*.pkg" 2>/dev/null || echo "No built artifacts found"
# Copy build artifacts - check multiple possible build directories
for BUILD_DIR in "build/buildlatest/Release" "build/Release" "build/*/Release"; do
if [ -d "./DirectHW/$BUILD_DIR" ]; then
echo "Found build directory for DMG: ./DirectHW/$BUILD_DIR"
find ./DirectHW/$BUILD_DIR -name "*.kext" -exec cp -r {} dmg_contents/ \; 2>/dev/null
find ./DirectHW/$BUILD_DIR -name "*.framework" -exec cp -r {} dmg_contents/ \; 2>/dev/null
find ./DirectHW/$BUILD_DIR -name "*.dylib" -exec cp {} dmg_contents/ \; 2>/dev/null
find ./DirectHW/$BUILD_DIR -name "*.a" -exec cp {} dmg_contents/ \; 2>/dev/null
break # Use first found build directory
fi
done
# Copy package if it exists
if [ -f "./DirectHW/DirectHW.pkg" ]; then
cp "./DirectHW/DirectHW.pkg" "dmg_contents/Install DirectHW.pkg"
fi
# Copy documentation
if [ -f "./DirectHW/ReadMe.rtf" ]; then
cp "./DirectHW/ReadMe.rtf" "dmg_contents/Read Me.rtf"
fi
if [ -f "./DirectHW/Welcome.rtf" ]; then
cp "./DirectHW/Welcome.rtf" "dmg_contents/Welcome.rtf"
fi
echo "=== DMG contents ==="
ls -la dmg_contents/
# Only create DMG if we have content
if [ "$(ls -A dmg_contents/)" ]; then
# Create DMG using create-dmg with custom layout
./create-dmg/create-dmg \
--volname "DirectHW v1.5.1" \
--window-size 700 400 \
--icon-size 96 \
--icon "Install DirectHW.pkg" 200 200 \
--icon "DirectHW.framework" 350 200 \
--icon "DirectHW.kext" 500 200 \
--icon "Read Me.rtf" 200 300 \
--icon "Welcome.rtf" 350 300 \
DirectHW-v1.5.1.dmg \
dmg_contents/ || echo "DMG creation failed, but content exists"
else
echo "No content for DMG, skipping DMG creation"
fi
- name: Upload DMG Artifact
uses: actions/upload-artifact@v4
if: always()
with:
name: DirectHW-DMG
path: |
DirectHW-v1.5.1.dmg
dmg_contents/
if-no-files-found: warn
- name: Upload Build Artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: DirectHW-Build-Artifacts
path: |
DirectHW/build/buildlatest/Release/
DirectHW/build/*/Release/
DirectHW/*.pkg
DirectHW/*.kext
DirectHW/*.framework
DirectHW/*.dylib
if-no-files-found: warn