-
Notifications
You must be signed in to change notification settings - Fork 0
220 lines (197 loc) · 8.3 KB
/
Copy pathdeployment.yaml
File metadata and controls
220 lines (197 loc) · 8.3 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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
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"
concurrency:
# Don't kill a release mid-upload; release tags are unique anyway.
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@v4
with:
ref: ${{ steps.tag.outputs.value }}
submodules: recursive
fetch-depth: 0
- 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 \
python3 python3-pip
- name: Install ldid
run: |
curl -L -o /tmp/ldid \
"https://github.com/ProcursusTeam/ldid/releases/download/${LDID_VERSION}/ldid_linux_x86_64"
sudo install -m 0755 /tmp/ldid /usr/local/bin/ldid
ldid -V || ldid 2>&1 | head -1 || true
- name: Cache Theos
id: cache-theos
uses: actions/cache@v4
with:
path: theos
key: theos-linux-${{ env.IOS_SDK_VERSION }}-v1
- name: Install Theos
if: steps.cache-theos.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
# Recipe<->dump cross-check (verify_sites) is NOT run here. It
# needs assets/dump.cs.index.json, which is .gitignored under the
# project's analysis-artifact layering (raw binaries and machine-
# generated dumps are not committed; only curated specs are). The
# check runs locally as a pre-commit hook (scripts/pre-commit,
# installed via `make hooks`) against the operator's own dump
# index. The release builds below only catch build-time errors;
# recipe-level mistakes (stale CAVE_REGION, prologue drift) are
# caught by `tools.patch_macho` when the operator runs `make ipa`
# against their own decrypted IPA.
# FINALPACKAGE=1 — Theos release-mode switch. Without it Theos
# builds at -O0 with debug symbols and stamps "+debug" into the
# .deb file name (e.g. *_0.2.0-1+debug_iphoneos-arm64.deb), which
# is fine locally but not what a tagged Release should ship. Each
# of the three make invocations below passes it so every CD
# artifact is built in release shape: -O3, stripped debug
# symbols, no "+debug" suffix on the .deb.
- 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)
# The chinlan flavor is what users pair with `make ipa` on
# their own host against a decrypted PiyoShogi IPA. Same
# Dobby-static link shape as the jailed dylib, but compiled with
# -DIPA_CHINLAN=1 so the constructor publishes hook function
# pointers into a reserved __DATA slot instead of inline-hooking
# __TEXT — the only mode that survives iOS 18's CSM.
run: |
make chinlan FINALPACKAGE=1
ls -la packages/chinlan/
- name: Sanity-check dylibs (no external hook engine)
# Both Dobby-static dylibs must NOT link to libsubstrate or
# libdobby — those references would brick TrollStore / patched
# IPA installs at load time.
run: |
for DYLIB in packages/jailed/PiyoShot.dylib \
packages/chinlan/PiyoShot.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
# We ship the .deb, the jailed dylib, and the chinlan dylib —
# but never the patched IPA itself, since that would re-bundle
# the decrypted PiyoShogi executable the operator supplied.
# Users wanting the patched IPA pair the chinlan dylib with
# `make ipa DECRYPTED_IPA=...` on their own host.
#
# Dylib names mirror the Theos .deb name shape:
# work.tkgstrator.piyoshot_<ver>-1_iphoneos-arm64-<flavor>.dylib
# so all three artifacts ship under the same bundle-id /
# version / arch prefix and only differ in the trailing flavor
# tag (jailed / chinlan). Grep-friendly and unambiguous.
run: |
mkdir -p dist
# Versioned .deb file name copied verbatim out of packages/.
cp packages/*.deb dist/
# Derive the dylib filename stem from the .deb itself, not
# from ./control. This way the dylibs track whatever shape
# Theos chose (including the package revision, any future
# rename, FINALPACKAGE / DEBUG toggle): we just strip the
# trailing ".deb" and append the flavor tag.
DEB=$(basename packages/*.deb .deb)
cp packages/jailed/PiyoShot.dylib \
"dist/${DEB}-jailed.dylib"
cp packages/chinlan/PiyoShot.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}"
# Pull the section between `## [<ver>]` and the next `## [`.
# Falls back to a one-liner if no CHANGELOG entry exists yet.
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
echo "----- release_notes.md -----"
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, '-') }}