Skip to content

Commit 916e9f0

Browse files
committed
Add ImageMagick installation and app icon generation to GitHub Actions workflow; update UserInterfaceState binary file in Xcode project workspace.
1 parent 32bd570 commit 916e9f0

File tree

4 files changed

+205
-0
lines changed

4 files changed

+205
-0
lines changed

.github/back/build.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Build IPA
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
permissions:
12+
contents: write
13+
pages: write
14+
id-token: write
15+
16+
jobs:
17+
build:
18+
runs-on: macos-latest
19+
20+
steps:
21+
- name: Checkout Repository
22+
uses: actions/checkout@v4
23+
24+
- name: Set up Xcode
25+
uses: maxim-lobanov/setup-xcode@v1
26+
with:
27+
xcode-version: '16.2.0'
28+
29+
- name: Install Dependencies (Homebrew & Theos)
30+
run: |
31+
echo "Installing Homebrew..."
32+
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
33+
34+
echo "Setting up Homebrew..."
35+
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> $HOME/.zprofile
36+
eval "$(/opt/homebrew/bin/brew shellenv)"
37+
38+
echo "Installing Theos dependencies..."
39+
brew install ldid dpkg
40+
41+
echo "Cloning Theos..."
42+
git clone --recursive https://github.com/theos/theos.git $HOME/theos
43+
echo 'export THEOS=$HOME/theos' >> $HOME/.zshrc
44+
export THEOS=$HOME/theos
45+
46+
- name: Build IPA Package
47+
run: |
48+
export THEOS=$HOME/theos
49+
echo "Building IPA package..."
50+
make package FINALPACKAGE=1 PACKAGE_FORMAT=ipa
51+
52+
- name: Get IPA File Path
53+
id: find_ipa
54+
run: |
55+
IPA_PATH=$(find ./packages -name "*.ipa" | head -n 1)
56+
echo "IPA File: $IPA_PATH"
57+
echo "ipa_path=$IPA_PATH" >> $GITHUB_ENV
58+
59+
- name: Upload IPA to GitHub Releases
60+
uses: softprops/action-gh-release@v2
61+
with:
62+
files: ${{ env.ipa_path }}
63+
tag_name: 'pakeplus-v1.0.0'
64+
body: 'pakeplus-v1.0.0'
65+
draft: false
66+
prerelease: false
67+
publish: false
68+
env:
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/build.yml

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ jobs:
3535
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> $HOME/.zprofile
3636
eval "$(/opt/homebrew/bin/brew shellenv)"
3737
38+
echo "Installing ImageMagick for App Icon resizing..."
39+
brew install imagemagick
40+
3841
echo "Installing Theos dependencies..."
3942
brew install ldid dpkg
4043
@@ -43,6 +46,139 @@ jobs:
4346
echo 'export THEOS=$HOME/theos' >> $HOME/.zshrc
4447
export THEOS=$HOME/theos
4548
49+
- name: Generate and Set App Icon
50+
run: |
51+
# 创建 Assets.xcassets 目录结构
52+
mkdir -p Assets.xcassets/AppIcon.appiconset
53+
54+
# 使用 ImageMagick 生成多尺寸图标
55+
convert appicon.png -resize 20x20 Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@1x.png
56+
convert appicon.png -resize 40x40 Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x.png
57+
convert appicon.png -resize 60x60 Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@3x.png
58+
convert appicon.png -resize 29x29 Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@1x.png
59+
convert appicon.png -resize 58x58 Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x.png
60+
convert appicon.png -resize 87x87 Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@3x.png
61+
convert appicon.png -resize 40x40 Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@1x.png
62+
convert appicon.png -resize 80x80 Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x.png
63+
convert appicon.png -resize 120x120 Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@3x.png
64+
convert appicon.png -resize 60x60 Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@1x.png
65+
convert appicon.png -resize 120x120 Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@2x.png
66+
convert appicon.png -resize 180x180 Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@3x.png
67+
convert appicon.png -resize 76x76 Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@1x.png
68+
convert appicon.png -resize 152x152 Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@2x.png
69+
convert appicon.png -resize 167x167 Assets.xcassets/AppIcon.appiconset/AppIcon-83.5x83.5@2x.png
70+
convert appicon.png -resize 1024x1024 Assets.xcassets/AppIcon.appiconset/AppIcon-1024x1024@1x.png
71+
72+
# 生成 Contents.json 配置文件
73+
cat > Assets.xcassets/AppIcon.appiconset/Contents.json <<EOL
74+
{
75+
"images": [
76+
{
77+
"size": "20x20",
78+
"idiom": "iphone",
79+
"filename": "AppIcon-20x20@1x.png",
80+
"scale": "1x"
81+
},
82+
{
83+
"size": "20x20",
84+
"idiom": "iphone",
85+
"filename": "AppIcon-20x20@2x.png",
86+
"scale": "2x"
87+
},
88+
{
89+
"size": "20x20",
90+
"idiom": "iphone",
91+
"filename": "AppIcon-20x20@3x.png",
92+
"scale": "3x"
93+
},
94+
{
95+
"size": "29x29",
96+
"idiom": "iphone",
97+
"filename": "AppIcon-29x29@1x.png",
98+
"scale": "1x"
99+
},
100+
{
101+
"size": "29x29",
102+
"idiom": "iphone",
103+
"filename": "AppIcon-29x29@2x.png",
104+
"scale": "2x"
105+
},
106+
{
107+
"size": "29x29",
108+
"idiom": "iphone",
109+
"filename": "AppIcon-29x29@3x.png",
110+
"scale": "3x"
111+
},
112+
{
113+
"size": "40x40",
114+
"idiom": "iphone",
115+
"filename": "AppIcon-40x40@1x.png",
116+
"scale": "1x"
117+
},
118+
{
119+
"size": "40x40",
120+
"idiom": "iphone",
121+
"filename": "AppIcon-40x40@2x.png",
122+
"scale": "2x"
123+
},
124+
{
125+
"size": "40x40",
126+
"idiom": "iphone",
127+
"filename": "AppIcon-40x40@3x.png",
128+
"scale": "3x"
129+
},
130+
{
131+
"size": "60x60",
132+
"idiom": "iphone",
133+
"filename": "AppIcon-60x60@1x.png",
134+
"scale": "1x"
135+
},
136+
{
137+
"size": "60x60",
138+
"idiom": "iphone",
139+
"filename": "AppIcon-60x60@2x.png",
140+
"scale": "2x"
141+
},
142+
{
143+
"size": "60x60",
144+
"idiom": "iphone",
145+
"filename": "AppIcon-60x60@3x.png",
146+
"scale": "3x"
147+
},
148+
{
149+
"size": "76x76",
150+
"idiom": "ipad",
151+
"filename": "AppIcon-76x76@1x.png",
152+
"scale": "1x"
153+
},
154+
{
155+
"size": "76x76",
156+
"idiom": "ipad",
157+
"filename": "AppIcon-76x76@2x.png",
158+
"scale": "2x"
159+
},
160+
{
161+
"size": "83.5x83.5",
162+
"idiom": "ipad",
163+
"filename": "AppIcon-83.5x83.5@2x.png",
164+
"scale": "2x"
165+
},
166+
{
167+
"size": "1024x1024",
168+
"idiom": "ios-marketing",
169+
"filename": "AppIcon-1024x1024@1x.png",
170+
"scale": "1x"
171+
}
172+
],
173+
"info": {
174+
"version": 1,
175+
"author": "xcode"
176+
}
177+
}
178+
EOL
179+
180+
echo "✅ App Icon 已生成并配置完成!"
181+
46182
- name: Build IPA Package
47183
run: |
48184
export THEOS=$HOME/theos
Binary file not shown.

appicon.png

58.9 KB
Loading

0 commit comments

Comments
 (0)