Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Commit

Permalink
add ci actions
Browse files Browse the repository at this point in the history
Signed-off-by: 82Flex <[email protected]>
  • Loading branch information
Lessica committed Dec 15, 2023
1 parent 89306b5 commit 765b61f
Show file tree
Hide file tree
Showing 5 changed files with 195 additions and 30 deletions.
128 changes: 128 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: Build Release

on:
push:
tags:
- "v*.*.*"

env:
THEOS: ''
GIT_TAG: ''
XCODE_VERSION: '14.3.1'

jobs:
build:
name: Build and upload release package for TrollStore
runs-on: macos-13

steps:
- name: Setup Xcode version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ env.XCODE_VERSION }}

- name: Install Homebrew Dependencies
run: |
brew install dpkg ldid make libplist openssl@3
echo "/usr/local/opt/make/libexec/gnubin" >> $GITHUB_PATH
- name: Checkout XXTouchNG/theos
uses: actions/checkout@v3
with:
repository: XXTouchNG/theos
ref: 78ee784d8d3238982c9abdc58cd39919263648b1
path: theos
submodules: recursive

- name: Add THEOS Environment Variables
run: |
rm -rf $GITHUB_WORKSPACE/theos/sdks
echo "THEOS=$GITHUB_WORKSPACE/theos" >> $GITHUB_ENV
- name: Restore Additional SDKs
id: cached-sdks-restore
uses: actions/cache/restore@v3
with:
path: ${{ env.THEOS }}/sdks
key: ${{ runner.os }}-sdks-${{ env.XCODE_VERSION }}

- if: ${{ steps.cached-sdks-restore.outputs.cache-hit != 'true' }}
name: Checkout theos/sdks
uses: actions/checkout@v3
with:
repository: theos/sdks
ref: master
path: ${{ env.THEOS }}/sdks

- if: ${{ steps.cached-sdks-restore.outputs.cache-hit != 'true' }}
name: Checkout XXTouchNG/tbd
uses: actions/checkout@v3
with:
repository: XXTouchNG/tbd
ref: 30a6883092221e13d814c02ac41af1e565a40617
path: tbd

- if: ${{ steps.cached-sdks-restore.outputs.cache-hit != 'true' }}
name: Build tbd
run: |
cd $GITHUB_WORKSPACE/tbd
make
cp bin/tbd /usr/local/bin/tbd
- if: ${{ steps.cached-sdks-restore.outputs.cache-hit != 'true' }}
name: Generate Additional SDKs
run: |
cd $THEOS/sdks
python3 create_patched_sdk.py --no-overwrite -x $(dirname $(dirname $(xcode-select -p)))
- if: ${{ steps.cached-sdks-restore.outputs.cache-hit != 'true' }}
name: Save Additional SDKs
id: cached-sdks-save
uses: actions/cache/save@v3
with:
path: ${{ env.THEOS }}/sdks
key: ${{ steps.cached-sdks-restore.outputs.cache-primary-key }}

- name: Checkout
uses: actions/checkout@v3
with:
repository: Lessica/TrollSpeed
ref: main
path: TrollSpeed
submodules: recursive

- name: Setup Build Environment
run: |
echo "Available SDKs: $(find $THEOS/sdks -name "*.sdk" -maxdepth 1 -print)"
echo "FINALPACKAGE=1" >> $GITHUB_ENV
cd $GITHUB_WORKSPACE/TrollSpeed
git fetch --tags
echo "GIT_TAG=$(git describe --tags --always --abbrev=0)" >> $GITHUB_ENV
- name: Build Package
run: |
cd $GITHUB_WORKSPACE/TrollSpeed
./gen-control.sh ${{ env.GIT_TAG }}
FINALPACKAGE=1 make stage
- name: Collect Symbols
run: |
cd $GITHUB_WORKSPACE/TrollSpeed
find .theos/obj -name "*.dSYM" -print | zip -r packages/TrollSpeed_${{ env.GIT_TAG }}_symbols.zip -@
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: TrollSpeed_${{ env.GIT_TAG }}
path: |
TrollSpeed/packages/TrollSpeed_*.tipa
- name: Upload Symbols
uses: actions/upload-artifact@v3
with:
name: TrollSpeed_${{ env.GIT_TAG }}_symbols
path: |
TrollSpeed/packages/TrollSpeed_${{ env.GIT_TAG }}_symbols.zip
- name: Upload Release
uses: softprops/action-gh-release@v1
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
ARCHS := arm64 # arm64e
TARGET := iphone:clang:16.4:14.0
TARGET := iphone:clang:latest:14.0
INSTALL_TARGET_PROCESSES := TrollSpeed

include $(THEOS)/makefiles/common.mk

APPLICATION_VERSION = 1.8.6
APPLICATION_NAME = TrollSpeed
GIT_TAG_SHORT := $(shell git describe --tags --always --abbrev=0)
APPLICATION_NAME := TrollSpeed

TrollSpeed_USE_MODULES := 0
TrollSpeed_FILES += $(wildcard *.mm *.m)
Expand All @@ -16,6 +16,7 @@ TrollSpeed_CFLAGS += -include hud-prefix.pch
TrollSpeed_CCFLAGS += -DNOTIFY_LAUNCHED_HUD=\"ch.xxtou.notification.hud.launched\"
TrollSpeed_CCFLAGS += -DNOTIFY_DISMISSAL_HUD=\"ch.xxtou.notification.hud.dismissal\"
TrollSpeed_CCFLAGS += -DNOTIFY_RELOAD_HUD=\"ch.xxtou.notification.hud.reload\"
MainApplication.mm_CCFLAGS += -std=c++14
TrollSpeed_FRAMEWORKS += CoreGraphics QuartzCore UIKit
TrollSpeed_PRIVATE_FRAMEWORKS += BackBoardServices GraphicsServices IOKit SpringBoardServices
ifeq ($(TARGET_CODESIGN),ldid)
Expand All @@ -29,5 +30,5 @@ include $(THEOS_MAKE_PATH)/application.mk
after-stage::
$(ECHO_NOTHING)mkdir -p packages $(THEOS_STAGING_DIR)/Payload$(ECHO_END)
$(ECHO_NOTHING)cp -rp $(THEOS_STAGING_DIR)/Applications/TrollSpeed.app $(THEOS_STAGING_DIR)/Payload$(ECHO_END)
$(ECHO_NOTHING)cd $(THEOS_STAGING_DIR); zip -qr TrollSpeed_$(APPLICATION_VERSION).tipa Payload; cd -;$(ECHO_END)
$(ECHO_NOTHING)mv $(THEOS_STAGING_DIR)/TrollSpeed_$(APPLICATION_VERSION).tipa packages/TrollSpeed_$(APPLICATION_VERSION).tipa $(ECHO_END)
$(ECHO_NOTHING)cd $(THEOS_STAGING_DIR); zip -qr TrollSpeed_${GIT_TAG_SHORT}.tipa Payload; cd -;$(ECHO_END)
$(ECHO_NOTHING)mv $(THEOS_STAGING_DIR)/TrollSpeed_${GIT_TAG_SHORT}.tipa packages/TrollSpeed_${GIT_TAG_SHORT}.tipa $(ECHO_END)
36 changes: 36 additions & 0 deletions gen-control.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/sh

# This script is used to generate the control file for the Debian package.
if [ $# -ne 1 ]; then
echo "Usage: $0 <version>"
exit 1
fi

VERSION=$1

# Strip leading "v" from version if present
VERSION=${VERSION#v}

# Create the layout directory
mkdir -p layout/DEBIAN

# Write the control file
cat > layout/DEBIAN/control << __EOF__
Package: ch.xxtou.hud
Name: HUD App
Version: $VERSION
Section: Tweaks
Depends: firmware (>= 13.0), mobilesubstrate (>= 0.9.7000), com.rpetrich.rocketbootstrap (>= 1.0.9)
Architecture: iphoneos-arm
Author: XXTouch Team.
Maintainer: XXTouch Team.
Description: Next generation XXTouch for iOS 13 and above.
__EOF__

# Set permissions
chmod 0644 layout/DEBIAN/control

# Write the Info.plist file
defaults write $(pwd)/layout/Applications/TrollSpeed.app/Info.plist CFBundleVersion $VERSION
defaults write $(pwd)/layout/Applications/TrollSpeed.app/Info.plist CFBundleShortVersionString $VERSION
plutil -convert xml1 $(pwd)/layout/Applications/TrollSpeed.app/Info.plist
48 changes: 24 additions & 24 deletions layout/Applications/TrollSpeed.app/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDisplayName</key>
<string>TrollSpeed</string>
<key>CFBundleExecutable</key>
<string>TrollSpeed</string>
<key>CFBundleIconFile</key>
<string>icon.png</string>
<key>CFBundleIdentifier</key>
<string>ch.xxtou.hudapp</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>TrollSpeed</string>
<key>CFBundleDisplayName</key>
<string>TrollSpeed</string>
<key>CFBundleVersion</key>
<string>1.8.6</string>
<key>CFBundleExecutable</key>
<string>TrollSpeed</string>
<key>NSPrincipalClass</key>
<string>HUDMainApplication</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleIconFile</key>
<string>icon.png</string>
<key>CFBundleShortVersionString</key>
<string>1.8.7</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -33,10 +33,14 @@
</array>
</dict>
</array>
<key>UIApplicationShowsViewsWhileLocked</key>
<false/>
<key>UIApplicationSystemWindowsSecureKey</key>
<true/>
<key>CFBundleVersion</key>
<string>1.8.7</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.developer-tools</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2009 Apple Inc. All Rights Reserved.</string>
<key>NSPrincipalClass</key>
<string>HUDMainApplication</string>
<key>UIApplicationShortcutItems</key>
<array>
<dict>
Expand All @@ -48,10 +52,12 @@
<string>ch.xxtou.shortcut.toggle-hud</string>
</dict>
</array>
<key>UIApplicationShowsViewsWhileLocked</key>
<false/>
<key>UIApplicationSystemWindowsSecureKey</key>
<true/>
<key>UIBackgroundStyle</key>
<string>UIBackgroundStyleDarkBlur</string>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIStatusBarStyle</key>
Expand All @@ -60,13 +66,7 @@
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>LSApplicationCategoryType</key>
<string>public.app-category.developer-tools</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2009 Apple Inc. All Rights Reserved.</string>
<key>CFBundleShortVersionString</key>
<string>1.8.6</string>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>
2 changes: 1 addition & 1 deletion layout/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: ch.xxtou.hud
Name: HUD App
Version: 1.8.6
Version: 1.8.7
Section: Tweaks
Depends: firmware (>= 13.0), mobilesubstrate (>= 0.9.7000), com.rpetrich.rocketbootstrap (>= 1.0.9)
Architecture: iphoneos-arm
Expand Down

0 comments on commit 765b61f

Please sign in to comment.