-
Notifications
You must be signed in to change notification settings - Fork 0
185 lines (162 loc) · 5.89 KB
/
Copy pathdeployment.yaml
File metadata and controls
185 lines (162 loc) · 5.89 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
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
183
184
185
name: deployment
on:
push:
tags:
- "v*.*.*"
workflow_dispatch:
inputs:
tag:
description: "Version tag to build (e.g. v0.2.0). Empty = use ref name."
required: false
default: ""
permissions:
contents: write
env:
THEOS: ${{ github.workspace }}/theos
IOS_SDK_VERSION: "16.5"
LDID_VERSION: "v2.1.5-procursus7"
LDID_SHA256: "4b8862b2fefa2cd7fa8f88cb0310779619aeaa8c72d6aff22f019b470f2fa99a"
concurrency:
group: deployment-${{ github.ref }}
cancel-in-progress: false
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Resolve tag
id: tag
run: |
if [ -n "${{ inputs.tag }}" ]; then
echo "value=${{ inputs.tag }}" >> "$GITHUB_OUTPUT"
else
echo "value=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
fi
- name: Checkout source at tag
uses: actions/checkout@v5
with:
ref: ${{ steps.tag.outputs.value }}
submodules: recursive
fetch-depth: 0
- name: Verify control version matches tag
run: |
TAG="${{ steps.tag.outputs.value }}"
VER="${TAG#v}"
CTRL_VER=$(grep -E '^Version:' control | awk '{print $2}')
echo "Tag version : ${VER}"
echo "Control version: ${CTRL_VER}"
if [ "${VER}" != "${CTRL_VER}" ]; then
echo "::error::control Version (${CTRL_VER}) does not match tag (${VER})"
exit 1
fi
- name: Install host build tools
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential curl git make perl xz-utils \
libplist-utils libc++-dev \
libtinfo6 libncurses6
- name: Install ldid
run: |
curl -L -o /tmp/ldid \
"https://github.com/ProcursusTeam/ldid/releases/download/${LDID_VERSION}/ldid_linux_x86_64"
echo "${LDID_SHA256} /tmp/ldid" | sha256sum -c -
sudo install -m 0755 /tmp/ldid /usr/local/bin/ldid
ldid -V || ldid 2>&1 | head -1 || true
- name: Cache Theos
id: theos-cache
uses: actions/cache@v5
with:
path: theos
key: theos-linux-${{ env.IOS_SDK_VERSION }}-v3
- name: Install Theos
if: steps.theos-cache.outputs.cache-hit != 'true'
run: |
git clone --recursive https://github.com/theos/theos.git "$THEOS"
ARCH=$(uname -m)
curl -fsSL \
"https://github.com/L1ghtmann/llvm-project/releases/latest/download/iOSToolchain-${ARCH}.tar.xz" \
| tar xJ -C "$THEOS/toolchain"
mkdir -p "$THEOS/sdks"
curl -L -o /tmp/sdk.tar.gz \
"https://github.com/theos/sdks/archive/master.tar.gz"
tar -xf /tmp/sdk.tar.gz -C /tmp
cp -R "/tmp/sdks-master/iPhoneOS${IOS_SDK_VERSION}.sdk" \
"$THEOS/sdks/"
- name: Verify Theos
run: |
test -d "$THEOS/sdks/iPhoneOS${IOS_SDK_VERSION}.sdk"
test -x "$THEOS/toolchain/linux/iphone/bin/clang"
"$THEOS/toolchain/linux/iphone/bin/clang" --version
- name: Build rootless .deb (MobileSubstrate)
run: |
make clean
make package FINALPACKAGE=1
ls -la packages/
- name: Build jailed .dylib (Dobby static)
run: |
make jailed FINALPACKAGE=1
ls -la packages/jailed/
- name: Build chinlan .dylib (iOS 18, __DATA slot table)
run: |
make chinlan FINALPACKAGE=1
ls -la packages/chinlan/
- name: Sanity-check dylibs (no external hook engine)
run: |
for DYLIB in packages/jailed/KiouEngineBridge.dylib \
packages/chinlan/KiouEngineBridge.dylib; do
test -f "$DYLIB"
if command -v otool >/dev/null 2>&1; then
otool -L "$DYLIB"
if otool -L "$DYLIB" | grep -E "libsubstrate|libdobby"; then
echo "::error::$DYLIB leaks an external hook-engine dependency"
exit 1
fi
else
strings "$DYLIB" | grep -E "libsubstrate|libdobby\.dylib" \
&& { echo "::error::$DYLIB leaks an external hook-engine dependency"; exit 1; } \
|| echo "$DYLIB: no external hook-engine references found"
fi
done
- name: Stage release assets
id: assets
run: |
mkdir -p dist
cp packages/*.deb dist/
DEB=$(basename packages/*.deb .deb)
cp packages/jailed/KiouEngineBridge.dylib \
"dist/${DEB}-jailed.dylib"
cp packages/chinlan/KiouEngineBridge.dylib \
"dist/${DEB}-chinlan.dylib"
ls -la dist/
- name: Compute SHA256 checksums
run: |
cd dist
sha256sum * > SHA256SUMS
cat SHA256SUMS
- name: Extract release notes from CHANGELOG
id: notes
run: |
TAG="${{ steps.tag.outputs.value }}"
VER="${TAG#v}"
awk -v ver="$VER" '
$0 ~ "^## \\[" ver "\\]" { in_section = 1; print; next }
in_section && /^## \[/ { exit }
in_section { print }
' CHANGELOG.md > release_notes.md
if [ ! -s release_notes.md ]; then
echo "(no CHANGELOG section for ${TAG}; see CHANGELOG.md for context)" \
> release_notes.md
fi
cat release_notes.md
- name: Publish release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.tag.outputs.value }}
name: ${{ steps.tag.outputs.value }}
body_path: release_notes.md
files: |
dist/*.deb
dist/*.dylib
dist/SHA256SUMS
fail_on_unmatched_files: true
prerelease: ${{ contains(steps.tag.outputs.value, '-') }}