Merge branch 'opa334:2.x' into 2.x #4006
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.5' | |
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 |