-
Notifications
You must be signed in to change notification settings - Fork 36
/
action.yml
93 lines (85 loc) · 2.86 KB
/
action.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
name: "Install Theos"
description: "Install Theos and prepare it for building projects"
author: "Randomblock1"
branding:
icon: download-cloud
color: purple
inputs:
theos-dir:
description: "Where to install Theos"
required: false
default: ${{ github.workspace }}/theos
theos-src:
description: "Where to clone Theos from (git URL)"
required: false
default: "https://github.com/theos/theos"
theos-sdks:
description: "Where to clone the iOS SDKs from (GitHub repository URL)"
required: false
default: "https://github.com/theos/sdks"
theos-sdks-branch:
description: "Which branch to clone from SDK repo"
required: false
default: "master"
orion:
description: "Whether to enable Orion, which adds support for Swift tweaks"
required: false
default: "false"
runs:
using: "composite"
steps:
- name: Setup (MacOS)
shell: bash
if: runner.os == 'macOS'
run: |
brew install ldid make
PATH="$(brew --prefix make)/libexec/gnubin:$PATH" >> $GITHUB_ENV
- name: Setup (Linux)
shell: bash
if: runner.os == 'Linux'
run: sudo apt install build-essential fakeroot libtinfo5 libz3-dev rsync curl perl unzip git libplist-utils
- name: Setup environment
shell: bash
run: echo "THEOS=${{ inputs.theos-dir }}" >> $GITHUB_ENV
- name: Download Theos
shell: bash
run: |
if [ ! -d "${{ inputs.theos-dir }}" ]; then
git clone ${{ inputs.theos-src }} ${{ inputs.theos-dir }} --recursive
echo "Theos successfully downloaded."
else
echo "Theos already cached."
fi
- name: Get toolchain (Linux)
shell: bash
if: runner.os == 'Linux'
run: |
if [[ "$(ls ${{ inputs.theos-dir }}/sdks)" ]]; then
echo "Linux toolchain already cached, skipping..."
else
TMP_DL=$(mktemp -d)
wget --no-verbose https://github.com/kabiroberai/swift-toolchain-linux/releases/download/v2.3.0/swift-5.8-ubuntu22.04.tar.xz -P $TMP_DL
tar -xvf $TMP_DL/swift-5.8-ubuntu22.04.tar.xz -C $THEOS/toolchain
rm -Rf $TMP_DL
fi
- name: Get SDKs
shell: bash
run: |
if [[ "$(ls ${{ inputs.theos-dir }}/sdks)" ]]; then
echo "Theos SDKs already cached, skipping..."
else
cd ${{ inputs.theos-dir }}/sdks
wget --no-verbose ${{ inputs.theos-sdks }}/archive/${{ inputs.theos-sdks-branch }}.zip
TMP=$(mktemp -d)
7z x ${{ inputs.theos-sdks-branch }}.zip -o$TMP
mv $TMP/*-${{ inputs.theos-sdks-branch }}/*.sdk $THEOS/sdks
rm -r ${{ inputs.theos-sdks-branch }}.zip $TMP
fi
- name: Enable Orion
shell: bash
if: inputs.orion == 'true'
run: |
cd ${{ inputs.theos-dir }}
git fetch
git checkout orion
git submodule update --init