Skip to content

【OTA】Better OTA upgrade logic #1339

【OTA】Better OTA upgrade logic

【OTA】Better OTA upgrade logic #1339

Workflow file for this run

name: build_Release
on:
push:
branches:
- 1.1
paths-ignore:
- ".gitignore"
workflow_dispatch:
env:
VERSION: '1.1.4_4'
jobs:
build:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Procursus
uses: wwg135/procursus-action@main
with:
packages: ldid trustcache make findutils coreutils
- name: Install THEOS
run: |
curl -fsSL https://raw.githubusercontent.com/theos/theos/master/bin/install-theos > theos
sed -i '' 's/get_sdks$//g' theos
bash theos
- 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 code and keychain
run: |
sed -i '' "s/AAA/更新时间/g" ./Dopamine/Dopamine/UI/Views/JailbreakView.swift
sed -i '' "s/AAB/${{ env.shT }}/g" ./Dopamine/Dopamine/UI/Views/JailbreakView.swift
sed -i '' "s/AAC/${{ env.msT }}/g" ./Dopamine/Dopamine/UI/Views/JailbreakView.swift
sed -i '' 's/MARKETING_VERSION = .*;/MARKETING_VERSION = ${{ env.VERSION }};/g' ./Dopamine/Dopamine.xcodeproj/project.pbxproj
sed -i '' "s/BBB/${{ env.VERSION }}/g" ./Packages/Fugu15KernelExploit/Sources/Fugu15KernelExploit/Fugu15.swift
sudo security import Exploits/fastPath/arm.pfx -k /Library/Keychains/System.keychain -P password -A
- name: Pre body
run: |
echo -e "[点击当前版本下载](https://github.com/wwg135/Dopamine/releases/download/${{ env.msT }}/Dopamine.ipa)" >> body.txt
echo -e "\n更新时间:${{ env.logT }}" >> body.txt
echo -e "\n**当前更新日志如下:**" >> body.txt
echo -e "\n> - 1.同步官方最新代码更新\n> - 2.修正ota升级逻辑,后续仅收到除1.0.5版本外,其他版本的ota升级\n> 3.改善代码,提高执行效率,不影响重启" >> body.txt
- name: Build ipa
run: |
set -x
export THEOS=$HOME/theos
gmake -j$(sysctl -n hw.physicalcpu)
mv Dopamine/Dopamine.tipa Dopamine.ipa
- name: Release
uses: softprops/action-gh-release@v1
with:
name: ${{ env.VERSION }}
tag_name: ${{ env.msT }}
target_commitish: 1.1
body_path: body.txt
latest: true
token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
files: |
*.ipa