Skip to content

Commit

Permalink
CI
Browse files Browse the repository at this point in the history
  • Loading branch information
level3tjg committed Mar 29, 2024
1 parent 6ed12fa commit 2d0019e
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 7 deletions.
114 changes: 114 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: CI

on:
push:
workflow_dispatch:
inputs:
create_release:
description: "Create draft release"
default: false
type: boolean

jobs:
build:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
with:
path: RedditFilter
submodules: recursive

- name: Get package info
id: package_info
run: |
cd RedditFilter
version=$(cat Makefile | grep "PACKAGE_VERSION =" | cut -d' ' -f3)
if [ -z $version ]; then
version=$(cat control | grep "Version:" | cut -d' ' -f2)
fi
echo "id=$(cat control | grep "Package:" | cut -d' ' -f2)" >> $GITHUB_OUTPUT
echo "version=$version" >> $GITHUB_OUTPUT
- name: Install dependencies
if: ${{ inputs.create_release }}
run: |
sudo apt update
sudo apt install -y build-essential checkinstall git autoconf automake libtool-bin rsync llvm xmlstarlet
curl -L https://github.com/libimobiledevice/libplist/releases/download/2.4.0/libplist-2.4.0.tar.bz2 | bzip2 -d | tar -x
cd libplist*
./configure
sudo make install
sudo ldconfig
- name: Download IPA
if: ${{ inputs.create_release }}
id: download_ipa
uses: level3tjg/decryptedappstore-action@main
with:
appstore_url: "https://apps.apple.com/me/app/reddit/id1064216828"
cache: true
path: ${{ github.workspace }}/App.ipa
token: ${{ secrets.DECRYPTEDAPPSTORE_SESSION_TOKEN }}

- name: Setup theos
uses: level3tjg/theos-action@main
with:
cache: true
cache-dir-theos: ${{ github.workspace }}/theos
cache-dir-sdks: ${{ github.workspace }}/theos/sdks

- name: Checkout theos-jailed
if: ${{ inputs.create_release }}
uses: actions/checkout@v4
with:
repository: level3tjg/theos-jailed
path: theos-jailed
submodules: recursive

- name: Install theos-jailed
if: ${{ inputs.create_release }}
run: |
./theos-jailed/install
cd libplist*
sudo make uninstall
- name: Build rootless deb
run: |
cd RedditFilter
make package
env:
FINALPACKAGE: 1
THEOS_PACKAGE_SCHEME: rootless

- name: Build rootful deb
run: |
cd RedditFilter
make clean package
env:
FINALPACKAGE: 1

- name: Build IPA
if: ${{ inputs.create_release }}
run: |
cd RedditFilter
make package
env:
FINALPACKAGE: 1
SIDELOADED: 1
IPA: ${{ github.workspace }}/App.ipa
APP_VERSION: ${{ steps.download_ipa.outputs.version }}

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ steps.package_info.outputs.id }}_${{ steps.package_info.outputs.version }}
path: RedditFilter/packages/*

- name: Create release
if: ${{ inputs.create_release }}
uses: softprops/action-gh-release@v2
with:
draft: true
files: RedditFilter/packages/*
tag_name: v${{ steps.download_ipa.outputs.version }}-${{ steps.package_info.outputs.version }}
17 changes: 11 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@ INSTALL_TARGET_PROCESSES = RedditApp Reddit

ARCHS = arm64

PACKAGE_VERSION = 1.1.3
ifdef APP_VERSION
PACKAGE_VERSION := $(APP_VERSION)-$(PACKAGE_VERSION)
endif

ifeq ($(SIDELOADED),1)
MODULES = jailed
CODESIGN_IPA = 0
MODULES = jailed
CODESIGN_IPA = 0
endif

include $(THEOS)/makefiles/common.mk
Expand All @@ -16,9 +21,9 @@ $(TWEAK_NAME)_FILES = $(wildcard *.x*) fishhook/fishhook.c
$(TWEAK_NAME)_CFLAGS = -fobjc-arc -Iinclude -Wno-module-import-in-extern-c
$(TWEAK_NAME)_INJECT_DYLIBS = $(THEOS_OBJ_DIR)/RedditSideloadFix.dylib

include $(THEOS_MAKE_PATH)/tweak.mk

ifeq ($(SIDELOADED),1)
SUBPROJECTS += RedditSideloadFix
include $(THEOS_MAKE_PATH)/aggregate.mk
SUBPROJECTS += RedditSideloadFix
include $(THEOS_MAKE_PATH)/aggregate.mk
endif

include $(THEOS_MAKE_PATH)/tweak.mk
2 changes: 1 addition & 1 deletion control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: com.level3tjg.redditfilter
Name: RedditFilter
Version: 1.1.3
Version: 1.0.0
Architecture: iphoneos-arm
Description: Filter out unwanted content from your Reddit feed
Depiction: https://level3tjg.me/repo/depictions/?p=com.level3tjg.redditfilter
Expand Down

0 comments on commit 2d0019e

Please sign in to comment.