Skip to content

Commit 984d1f9

Browse files
committed
Update GitHub Actions workflow for iOS build process
- Change workflow name to "iOS Build (Unsigned IPA)" - Enable push triggers for the main branch - Update macOS runner to latest version - Modify steps to use xcodebuild for building the IPA - Create ExportOptions.plist for ad-hoc signing - Upload unsigned IPA as an artifact
1 parent 6a385b1 commit 984d1f9

File tree

2 files changed

+83
-98
lines changed

2 files changed

+83
-98
lines changed

.github/back/build.yml

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
name: Build IPA
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
pull_request:
8-
branches:
9-
- main
4+
workflow_dispatch:
5+
# push:
6+
# branches:
7+
# - main
108

119
permissions:
1210
contents: write
@@ -15,7 +13,7 @@ permissions:
1513

1614
jobs:
1715
build:
18-
runs-on: macos-latest
16+
runs-on: macos-15
1917

2018
steps:
2119
- name: Checkout Repository
@@ -24,7 +22,7 @@ jobs:
2422
- name: Set up Xcode
2523
uses: maxim-lobanov/setup-xcode@v1
2624
with:
27-
xcode-version: '16.2.0'
25+
xcode-version: '16.0.0'
2826

2927
- name: Install Dependencies (Homebrew & Theos)
3028
run: |
@@ -43,6 +41,16 @@ jobs:
4341
echo 'export THEOS=$HOME/theos' >> $HOME/.zshrc
4442
export THEOS=$HOME/theos
4543
44+
- uses: pnpm/action-setup@v3
45+
with:
46+
version: latest
47+
48+
- name: Sync node version and setup cache
49+
uses: actions/setup-node@v4
50+
with:
51+
node-version: 20
52+
cache: pnpm
53+
4654
- name: Build IPA Package
4755
run: |
4856
export THEOS=$HOME/theos
@@ -56,14 +64,26 @@ jobs:
5664
echo "IPA File: $IPA_PATH"
5765
echo "ipa_path=$IPA_PATH" >> $GITHUB_ENV
5866
67+
- name: Rename IPA File
68+
run: |
69+
NAME="${{ env.NAME }}"
70+
VERSION="${{ env.VERSION }}"
71+
IPA_PATH="${{ env.ipa_path }}"
72+
DIR=$(dirname "$IPA_PATH")
73+
NEW_NAME="${NAME}-${VERSION}.ipa"
74+
NEW_PATH="${DIR}/${NEW_NAME}"
75+
mv "$IPA_PATH" "$NEW_PATH"
76+
echo "Renamed IPA: $NEW_PATH"
77+
echo "ipa_path=$NEW_PATH" >> $GITHUB_ENV
78+
ls -l $DIR
79+
5980
- name: Upload IPA to GitHub Releases
60-
uses: softprops/action-gh-release@v2
81+
uses: softprops/action-gh-release@v1
6182
with:
6283
files: ${{ env.ipa_path }}
63-
tag_name: 'pakeplus-v1.0.0'
64-
body: 'pakeplus-v1.0.0'
84+
tag_name: '${{ env.NAME }}'
85+
name: '${{ env.NAME }} v${{ env.VERSION }}'
86+
body: '${{ env.PUBBODY }}'
6587
draft: false
66-
prerelease: false
67-
publish: false
6888
env:
6989
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/build.yml

Lines changed: 50 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,54 @@
1-
name: Build IPA
1+
name: iOS Build (Unsigned IPA)
22

33
on:
4-
workflow_dispatch:
5-
# push:
6-
# branches:
7-
# - main
8-
9-
permissions:
10-
contents: write
11-
pages: write
12-
id-token: write
4+
workflow_dispatch: # 手动触发
5+
push:
6+
branches:
7+
- main
138

149
jobs:
15-
build:
16-
runs-on: macos-15
17-
18-
steps:
19-
- name: Checkout Repository
20-
uses: actions/checkout@v4
21-
22-
- name: Set up Xcode
23-
uses: maxim-lobanov/setup-xcode@v1
24-
with:
25-
xcode-version: '16.0.0'
26-
27-
- name: Install Dependencies (Homebrew & Theos)
28-
run: |
29-
echo "Installing Homebrew..."
30-
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
31-
32-
echo "Setting up Homebrew..."
33-
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> $HOME/.zprofile
34-
eval "$(/opt/homebrew/bin/brew shellenv)"
35-
36-
echo "Installing Theos dependencies..."
37-
brew install ldid dpkg
38-
39-
echo "Cloning Theos..."
40-
git clone --recursive https://github.com/theos/theos.git $HOME/theos
41-
echo 'export THEOS=$HOME/theos' >> $HOME/.zshrc
42-
export THEOS=$HOME/theos
43-
44-
- uses: pnpm/action-setup@v3
45-
with:
46-
version: latest
47-
48-
- name: Sync node version and setup cache
49-
uses: actions/setup-node@v4
50-
with:
51-
node-version: 20
52-
cache: pnpm
53-
54-
- name: Build IPA Package
55-
run: |
56-
export THEOS=$HOME/theos
57-
echo "Building IPA package..."
58-
make package FINALPACKAGE=1 PACKAGE_FORMAT=ipa
59-
60-
- name: Get IPA File Path
61-
id: find_ipa
62-
run: |
63-
IPA_PATH=$(find ./packages -name "*.ipa" | head -n 1)
64-
echo "IPA File: $IPA_PATH"
65-
echo "ipa_path=$IPA_PATH" >> $GITHUB_ENV
66-
67-
- name: Rename IPA File
68-
run: |
69-
NAME="${{ env.NAME }}"
70-
VERSION="${{ env.VERSION }}"
71-
IPA_PATH="${{ env.ipa_path }}"
72-
DIR=$(dirname "$IPA_PATH")
73-
NEW_NAME="${NAME}-${VERSION}.ipa"
74-
NEW_PATH="${DIR}/${NEW_NAME}"
75-
mv "$IPA_PATH" "$NEW_PATH"
76-
echo "Renamed IPA: $NEW_PATH"
77-
echo "ipa_path=$NEW_PATH" >> $GITHUB_ENV
78-
ls -l $DIR
79-
80-
- name: Upload IPA to GitHub Releases
81-
uses: softprops/action-gh-release@v1
82-
with:
83-
files: ${{ env.ipa_path }}
84-
tag_name: '${{ env.NAME }}'
85-
name: '${{ env.NAME }} v${{ env.VERSION }}'
86-
body: '${{ env.PUBBODY }}'
87-
draft: false
88-
env:
89-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10+
build:
11+
runs-on: macos-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Select Xcode version
18+
run: sudo xcode-select -s /Applications/Xcode_16.3.app
19+
20+
- name: Build archive
21+
run: |
22+
xcodebuild clean archive \
23+
-project PakePlus.xcworkspace \ # 如果是.xcodeproj就改成 -project
24+
-scheme PakePlus \
25+
-configuration Release \
26+
-archivePath $PWD/build/PakePlus.xcarchive \
27+
SKIP_INSTALL=NO \
28+
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
29+
30+
- name: Create ExportOptions.plist
31+
run: |
32+
cat > ExportOptions.plist <<EOF
33+
{
34+
"compileBitcode": false,
35+
"method": "ad-hoc",
36+
"signingStyle": "manual",
37+
"stripSwiftSymbols": true,
38+
"teamID": "",
39+
"thinning": "<none>"
40+
}
41+
EOF
42+
43+
- name: Export IPA (Unsigned)
44+
run: |
45+
xcodebuild -exportArchive \
46+
-archivePath $PWD/build/PakePlus.xcarchive \
47+
-exportOptionsPlist ExportOptions.plist \
48+
-exportPath $PWD/build
49+
50+
- name: Upload IPA Artifact
51+
uses: actions/upload-artifact@v4
52+
with:
53+
name: PakePlus-unsigned-ipa
54+
path: build/*.ipa

0 commit comments

Comments
 (0)