forked from opa334/Dopamine
-
Notifications
You must be signed in to change notification settings - Fork 7
128 lines (111 loc) · 4.02 KB
/
main.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
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
name: build_Release
on:
push:
branches:
- '*'
paths-ignore:
- ".gitignore"
pull_request:
branches:
- '*'
paths-ignore:
- ".gitignore"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
env:
VERSION: '2.1.7'
BUNDLEID: 'com.wwg135.Dopamine'
jobs:
build:
runs-on: macos-13
environment: Auto Build And Release
steps:
- name: Checkout
uses: actions/[email protected]
with:
submodules: recursive
- name: Pre Procursus
uses: wwg135/procursus-action@main
with:
packages: ldid findutils coreutils make sed
- name: Pre trustcache
run: |
set -x
git clone https://github.com/CRKatri/trustcache
cd trustcache
gmake -j$(sysctl -n hw.physicalcpu) OPENSSL=1
sudo cp trustcache /opt/procursus/bin/
- name: Pre theos
run: |
set -x
export BASEDIR="$(pwd)"
export THEOS="${BASEDIR}/theos"
mkdir -p $THEOS
curl -fsSL https://raw.githubusercontent.com/theos/theos/master/bin/install-theos >> install-theos.sh
gsed -E "/^\s*get_theos\s*$/,+1 s/^(\s*)(get_sdks)\s*$/\1mkdir -p \${THEOS}\/sdks\n\1touch \${THEOS}\/sdks\/sdk\n\1\2/g" -i install-theos.sh
bash install-theos.sh
curl -L https://github.com/theos/sdks/releases/latest/download/iPhoneOS16.5.sdk.tar.xz --output $THEOS/sdks/iPhoneOS16.5.sdk.tar.xz
gunzip $THEOS/sdks/iPhoneOS16.5.sdk.tar.xz
tar -xf $THEOS/sdks/iPhoneOS16.5.sdk.tar -C $THEOS/sdks
rm $THEOS/sdks/iPhoneOS16.5.sdk.tar
cd $BASEDIR
- name: Pre Bundleid
run: |
sed -i '' "s/com.opa334.Dopamine/${{ env.BUNDLEID }}/g" ./Application/Dopamine/Jailbreak/DOPreferenceManager.m
sed -i '' "s/com.opa334.Dopamine/${{ env.BUNDLEID }}/g" ./Application/Dopamine.xcodeproj/project.pbxproj
sed -i '' "s/com.opa334.Dopamine/${{ env.BUNDLEID }}/g" ./BaseBin/jbctl/src/main.m
- name: Set env
run: |
sT=$(TZ=UTC-8 date +'%S')
echo "msT=$(date -j -f "%Y-%m-%d %H:%M:%S" "$(TZ=UTC-8 date +'%Y-%m-%d %H:%M'):${sT}" +%s)" >> $GITHUB_ENV
echo "shT=$(TZ=UTC-8 date +'%Y-%m-%d'' ''%H:%M:%S')" >> $GITHUB_ENV
echo "logT=$(TZ=UTC-8 date +'%Y年%m月%d %H:%M'):${sT}" >> $GITHUB_ENV
- name: Print env
run: |
echo ${{ env.VERSION }}
echo ${{ env.msT }}
echo ${{ env.shT }}
echo ${{ env.logT }}
- name: Pre Version
run: |
echo "${{ env.VERSION }}" >./BaseBin/_external/basebin/.version
sed -i '' 's/MARKETING_VERSION = .*;/MARKETING_VERSION = ${{ env.VERSION }};/g' ./Application/Dopamine.xcodeproj/project.pbxproj
sed -i '' "s/AAA/更新时间:${{ env.shT }} 由M哥编译/g" ./Application/Dopamine/UI/DOMainViewController.m
- name: Install libarchive
run: |
brew install libarchive
- name: Download Bootstraps
run: |
set -x
cd Application/Dopamine/Resources
./download_bootstraps.sh
- name: Build ipa
run: |
set -x
export BASEDIR="$(pwd)"
export THEOS="${BASEDIR}/theos"
gmake -j$(sysctl -n hw.physicalcpu) NIGHTLY=1
mv Application/Dopamine.tipa Dopamine.ipa
- name: Release Logs
run: |
set -x
echo -e "更新时间:${{ env.logT }}" >> body.txt
echo "" >> ./release.md
cat body.txt > release.txt
echo "" >> release.txt
cat ./release.md >> release.txt
- name: Release ipa
uses: softprops/[email protected]
with:
name: ${{ env.VERSION }}
tag_name: ${{ env.VERSION }}
target_commitish: 2.x
body_path: release.txt
latest: true
token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
files: |
*.ipa