forked from rust-mobile/xbuild
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (68 loc) · 2.99 KB
/
sdk.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
on:
release:
types:
- created
name: sdk
jobs:
android:
runs-on: ubuntu-latest
steps:
- run: |
# ANDROID_NDK_LATEST_HOME is defined in the github ubuntu-latest runner. If this needs to be installed on a different image
# this can be done by running `sdkmanager "ndk;VERSION"` and setting `ANDROID_NDK_LATEST_HOME` to `$ANDROID_HOME/ndk/VERSION`.
TOOLCHAIN="$ANDROID_NDK_LATEST_HOME/toolchains/llvm/prebuilt/linux-x86_64"
CLANG_VERSION="$(ls $TOOLCHAIN/lib/clang)"
CLANG="$TOOLCHAIN/lib/clang/$CLANG_VERSION"
echo "ANDROID_NDK_LATEST_HOME=$ANDROID_NDK_LATEST_HOME"
echo "CLANG_VERSION=$CLANG_VERSION"
mkdir -p Android.ndk && cd Android.ndk
cp -r $TOOLCHAIN/sysroot/usr ./usr
cp -r $CLANG/lib/linux/aarch64/* ./usr/lib/aarch64-linux-android/
cp -r $CLANG/lib/linux/arm/* ./usr/lib/arm-linux-androideabi/
cp -r $CLANG/lib/linux/x86_64/* ./usr/lib/x86_64-linux-android/
cp -r $CLANG/lib/linux/i386/* ./usr/lib/i686-linux-android/
echo "INPUT(-lunwind)" > ./usr/lib/aarch64-linux-android/libgcc.a
echo "INPUT(-lunwind)" > ./usr/lib/arm-linux-androideabi/libgcc.a
echo "INPUT(-lunwind)" > ./usr/lib/x86_64-linux-android/libgcc.a
echo "INPUT(-lunwind)" > ./usr/lib/i686-linux-android/libgcc.a
- run: tar --zstd -cf Android.ndk.tar.zst Android.ndk
- run: gh release upload $TAG Android.ndk.tar.zst -R Traverse-Research/xbuild
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ github.event.release.tag_name }}
macos:
runs-on: macos-11
steps:
- run: ls /Applications/Xcode*
- run: cp -R $SDK_PATH .
env:
SDK_PATH: /Applications/Xcode_13.2.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
- run: gtar --zstd -cf MacOSX.sdk.tar.zst MacOSX.sdk
- run: gh release upload $TAG MacOSX.sdk.tar.zst -R Traverse-Research/xbuild
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ github.event.release.tag_name }}
ios:
runs-on: macos-11
steps:
- run: ls /Applications/Xcode*
- run: cp -R $SDK_PATH .
env:
SDK_PATH: /Applications/Xcode_13.2.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk
- run: gtar --zstd -cf iPhoneOS.sdk.tar.zst iPhoneOS.sdk
- run: gh release upload $TAG iPhoneOS.sdk.tar.zst -R Traverse-Research/xbuild
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ github.event.release.tag_name }}
windows:
runs-on: ubuntu-latest
steps:
- name: Install rust toolchain
uses: hecrj/setup-rust-action@v1
- run: cargo install xwin
- run: xwin --accept-license splat --output Windows.sdk
- run: tar --zstd -cf Windows.sdk.tar.zst Windows.sdk
- run: gh release upload $TAG Windows.sdk.tar.zst -R Traverse-Research/xbuild
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ github.event.release.tag_name }}