-
Notifications
You must be signed in to change notification settings - Fork 5
183 lines (155 loc) · 7.54 KB
/
get_apple_sdks.yml
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
name: Gather XCode SDKs for OSXCROSS
on:
workflow_dispatch:
inputs:
do_deploy:
description: Does this get deployed to Digital Ocean?
required: true
type: boolean
default: false
tar_files:
description: Do you want to Tar Files?
required: true
type: boolean
default: false
xcode_version:
description: Version of Xcode to copy the SDKs from
required: true
type: string
default: "15.4"
build_type:
description: nightly, prerelease, release
required: true
type: string
default: "nightly"
env:
BASE_FOLDER: deps
XCODE_VERSION: ${{ inputs.xcode_version }}
jobs:
build-osxcross-sdk:
name: Build osxcross SDK for Linux
runs-on: macos-latest
steps:
- name: Install Required Dependencies
run: |
brew install cmake wget coreutils llvm
echo "✅ Dependencies installed successfully." >> $GITHUB_STEP_SUMMARY
- name: Clone and Setup osxcross
run: |
git clone https://github.com/tpoechtrager/osxcross.git ~/osxcross
cd ~/osxcross
echo "✅ osxcross repository cloned." >> $GITHUB_STEP_SUMMARY
- name: Generate SDK Package
run: |
cd ~/osxcross
XCODE_VERSION=15.4
./tools/gen_sdk_package.sh "/Applications/Xcode_$XCODE_VERSION.app"
echo "✅ SDK package generated using gen_sdk_package.sh." >> $GITHUB_STEP_SUMMARY
- name: Build Clang
run: |
cd ~/osxcross
./build_clang.sh
echo "✅ Clang built successfully." >> $GITHUB_STEP_SUMMARY
- name: Build GCC
run: |
cd ~/osxcross
GCC_VERSION=12.2.0 ENABLE_FORTRAN=1 ./build_gcc.sh
echo "✅ GCC built successfully (version 12.2.0 with Fortran enabled)." >> $GITHUB_STEP_SUMMARY
- name: Build osxcross
run: |
cd ~/osxcross
export OSXCROSS_ENABLE_WERROR_IMPLICIT_FUNCTION_DECLARATION=1
export OSXCROSS_GCC_NO_STATIC_RUNTIME=1
UNATTENDED=1 TARGET_DIR=/usr/local/osxcross ./build.sh
echo "✅ osxcross built successfully." >> $GITHUB_STEP_SUMMARY
- name: Validate osxcross Installation
run: |
/usr/local/osxcross/bin/x86_64-apple-darwin20.2-clang --version
/usr/local/osxcross/bin/x86_64-apple-darwin20.2-gcc --version
echo "✅ osxcross installation validated." >> $GITHUB_STEP_SUMMARY
- name: Upload osxcross SDK as Artifact
uses: actions/upload-artifact@v4
with:
name: osxcross-sdk-linux
path: /usr/local/osxcross/
- name: Summary of Process
run: |
echo "### osxcross SDK Build Process Summary" >> $GITHUB_STEP_SUMMARY
echo "1. **Dependencies**: Installed cmake, wget, coreutils, and llvm." >> $GITHUB_STEP_SUMMARY
echo "2. **SDK Package Generation**: Used gen_sdk_package.sh with Xcode 15.4." >> $GITHUB_STEP_SUMMARY
echo "3. **Clang Setup**: Built Clang for osxcross." >> $GITHUB_STEP_SUMMARY
echo "4. **GCC Setup**: Built GCC version 12.2.0 with Fortran support." >> $GITHUB_STEP_SUMMARY
echo "5. **osxcross Setup**: Built osxcross using the generated SDK package and installed to /usr/local/osxcross." >> $GITHUB_STEP_SUMMARY
echo "6. **Environment**: Enabled -Werror=implicit-function-declaration and disabled static linking for libgcc/libstdc++." >> $GITHUB_STEP_SUMMARY
echo "7. **Validation**: Verified both Clang and GCC cross-compilers." >> $GITHUB_STEP_SUMMARY
echo "8. **Artifact**: osxcross SDK uploaded for Linux." >> $GITHUB_STEP_SUMMARY
- name: Cleanup
if: always()
run: |
rm -rf ~/osxcross
echo "✅ Cleanup completed." >> $GITHUB_STEP_SUMMARY
gather:
name: Process XCode SDKs
if: false
runs-on: "macos-latest"
steps:
- name: Set up Base Folder
id: base_folder
run: |
mkdir -p "$(pwd)/$BASE_FOLDER"
echo "base_folder=$(pwd)/$BASE_FOLDER" >> $GITHUB_OUTPUT
- name: XCode
run: |
xcode-select --print-path >> $GITHUB_STEP_SUMMARY
sudo xcodebuild -license accept
- name: List SDKs and Developer Platforms
run: |
echo '### Base Directory' >> $GITHUB_STEP_SUMMARY
ls -la /Applications/ >> $GITHUB_STEP_SUMMARY
echo '### Toolchains Directory' >> $GITHUB_STEP_SUMMARY
ls -la /Applications/Xcode_$XCODE_VERSION.app/Contents/Developer/Toolchains/ >> $GITHUB_STEP_SUMMARY
ls -la /Applications/Xcode_$XCODE_VERSION.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/ >> $GITHUB_STEP_SUMMARY
cat /Applications/Xcode_$XCODE_VERSION.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/ToolchainInfo.plist >> $GITHUB_STEP_SUMMARY
ls -la /Applications/Xcode_$XCODE_VERSION.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr >> $GITHUB_STEP_SUMMARY
ls -la /Applications/Xcode_$XCODE_VERSION.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include >> $GITHUB_STEP_SUMMARY
echo '### Platforms Directory' >> $GITHUB_STEP_SUMMARY
ls -la /Applications/Xcode_$XCODE_VERSION.app/Contents/Developer/Platforms/ >> $GITHUB_STEP_SUMMARY
ls -la /Applications/Xcode_$XCODE_VERSION.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs >> $GITHUB_STEP_SUMMARY
ls -la /Applications/Xcode_$XCODE_VERSION.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs >> $GITHUB_STEP_SUMMARY
ls -la /Applications/Xcode_$XCODE_VERSION.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs >> $GITHUB_STEP_SUMMARY
- name: Create tar.xz archives for iPhoneOS directories
if: ${{ inputs.tar_files }}
run: |
SDK_PATH="/Applications/Xcode_$XCODE_VERSION.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs"
for sdk in $(ls "$SDK_PATH" | grep iPhoneOS | grep -v iPhoneOS.sdk); do
sudo tar -cJvhf "$(pwd)/$BASE_FOLDER/${sdk}.tar.xz" "$SDK_PATH/$sdk"
done
- name: Create tar.xz archives for iPhoneSimulator directories
if: ${{ inputs.tar_files }}
run: |
SDK_PATH="/Applications/Xcode_$XCODE_VERSION.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs"
for sdk in $(ls "$SDK_PATH" | grep iPhoneSimulator | grep -v iPhoneSimulator.sdk); do
sudo tar -cJvhf "$(pwd)/$BASE_FOLDER/${sdk}.tar.xz" "$SDK_PATH/$sdk"
done
- name: Create tar.xz archives for MacOSX directories
if: ${{ inputs.tar_files }}
run: |
SDK_PATH="/Applications/Xcode_$XCODE_VERSION.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs"
for sdk in $(ls "$SDK_PATH" | grep MacOSX | grep -v MacOSX.sdk); do
sudo tar -cJvhf "$(pwd)/$BASE_FOLDER/${sdk}.tar.xz" "$SDK_PATH/$sdk"
done
- name: List Base Folder Contents and Add to Summary
if: ${{ inputs.tar_files }}
run: |
ls -la "$(pwd)/$BASE_FOLDER" >> $GITHUB_STEP_SUMMARY
- uses: BetaHuhn/do-spaces-action@v2
name: Deploy to DigitalOcean
if: ${{ inputs.do_deploy }}
id: spaces
with:
access_key: ${{ secrets.DO_ACCESS_KEY }}
secret_key: ${{ secrets.DO_SECRET_KEY }}
space_name: ${{ secrets.DO_SPACE_NAME }}
space_region: ${{ secrets.DO_SPACE_REGION }}
source: ${{ env.BASE_FOLDER }}
out_dir: pipeline