Skip to content

Commit f4d8cb9

Browse files
committed
feat: add Actions building, continue work
fix xcconfig values (thanks @stossy11 for the help) add accent color and optimize app icon add AltStore/SideStore/-next group containers cleanup code and add helpers for various tasks
1 parent 7abcf66 commit f4d8cb9

14 files changed

Lines changed: 402 additions & 113 deletions

File tree

‎.github/makeipa‎

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
_main() {
6+
local BDT="${1:-nightly}"
7+
local APP="${2:-SideBackup}"
8+
local OUT="build.xcarchive/Products/Applications/$APP.app"
9+
local SDR="build.xcarchive/dSYMs"
10+
local SYM="$APP.app.dSYM"
11+
local BVR=$(grep 'MARKETING' Build.xcconfig | awk '{ print $3 }')
12+
local BARGS="archive\
13+
-scheme $APP\
14+
-archivePath build.xcarchive\
15+
-destination generic/platform=iOS"
16+
if [[ "$BDT" == "release" ]]; then
17+
local VER="$BVR"
18+
local ARGS="$BARGS"
19+
local OPA="build/$APP.ipa"
20+
else
21+
local VER="$BVR-nightly.$(date +'%y.%m.%d_%H.%M')+$(git rev-parse --short HEAD)"
22+
local ARGS="$BARGS MARKETING_VERSION=$VER"
23+
local OPA="build/$APP.$VER.ipa"
24+
fi
25+
26+
_mkipa() {
27+
p=Payload
28+
mkdir $p
29+
mv "${1%.*}.app" $p
30+
zip -qr9 "${1%.*}.ipa" $p
31+
rm -r $p
32+
}
33+
34+
[[ -d "build" ]] && rm -r build || true && mkdir build
35+
[[ -f "build.xcarchive" ]] && rm -r build.xcarchive
36+
echo "::group::Build $BDT"
37+
echo "[$VER] Building.."
38+
set -o pipefail && xcodebuild $ARGS | tee "build/$VER.log" | xcbeautify --renderer github-actions
39+
echo "[$VER] Archiving.."
40+
xz -e "build/$VER.log"
41+
_mkipa "$OUT"
42+
tar cf "build/$SYM.$VER.tar" -C "$SDR" "$SYM"
43+
xz -e "build/$SYM.$VER.tar"
44+
mv "${OUT%.*}.ipa" "$OPA"
45+
rm -r build.xcarchive
46+
#tar cvJf "build.$VER.tar.xz" build
47+
echo "[$VER] Done!"
48+
echo "::endgroup::"
49+
}
50+
51+
_main "$@"

‎.github/workflows/build.yml‎

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Build SideBackup
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
tags:
8+
- '*.*.*'
9+
10+
jobs:
11+
build:
12+
name: Build and Archive
13+
runs-on: macos-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Install Xcode
22+
uses: maxim-lobanov/setup-xcode@v1
23+
with:
24+
xcode-version: latest-stable
25+
26+
- name: Install Dependencies
27+
run: brew install xcbeautify xz
28+
29+
- name: Determine Build Type
30+
id: build_type
31+
run: |
32+
if [[ "${GITHUB_REF}" == ref/tags/* ]]; then
33+
echo "type=release" >> $GITHUB_OUTPUT
34+
else
35+
echo "type=nightly" >> $GITHUB_OUTPUT
36+
fi
37+
38+
- name: Build
39+
run: ./.github/makeipa ${{ steps.build_type.outputs.type }}
40+
41+
- name: Upload nightly
42+
if: steps.build_type.outputs.type == 'nightly'
43+
uses: IsaacShelton/update-existing-release@v1
44+
with:
45+
token: ${{ secrets.GITHUB_TOKEN }}
46+
release: nightly
47+
replace: true
48+
files: build/*
49+
prerelease: true
50+
tag: nightly
51+
body: |
52+
Automated nightly build from commit ${{ github.sha }}
53+
54+
**Branch:** ${{ github.ref_name }}
55+
**Commit:** ${{ github.event.head_commit.message }}
56+
**Built:** ${{ github.event.head_commit.timestamp }}
57+
58+
- name: Upload Release
59+
if: steps.build_type.outputs.type == 'release'
60+
uses: softprops/action-gh-release@v2
61+
with:
62+
files: build/*
63+
draft: true
64+
prerelease: false
65+
env:
66+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
CodeSigning.xcconfig
22
xcuserdata/
3+
*.xcarchive
4+
build/

‎Build.xcconfig‎

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,38 @@ MARKETING_VERSION = 0.0.0
55
CURRENT_PROJECT_VERSION = 0000
66

77
// Vars to be overwritten by `CodeSigning.xcconfig` if exists
8+
ORG = io.SideStore
89
DEVELOPMENT_TEAM = HXY2D2FQXT
9-
ORG_IDENTIFIER = io.SideStore
10-
1110
CODE_SIGN_STYLE = Automatic
12-
DEVELOPMENT_TEAM[config=Archive] = XYZ0123456
11+
12+
// Vars that allow anyone to export a build via 'Product > Archive' in Xcode
1313
CODE_SIGN_STYLE[config=Archive] = Manual
14-
CODE_SIGNING_REQUIRED[config=Archive] = NO
14+
DEVELOPMENT_TEAM[config=Archive] = XYZ0123456
15+
CODE_SIGN_IDENTITY[config=Archive] = -
16+
CODE_SIGNING_ALLOWED[config=Archive] = YES
17+
CODE_SIGNING_REQUIRED[config=Archive] = YES
1518
AD_HOC_CODE_SIGNING_ALLOWED[config=Archive] = YES
16-
CODE_SIGNING_ALLOWED[config=Archive] = NO
1719

1820
// Codesigning settings defined optionally, see `CodeSigning.xcconfig.example`
1921
#include? "CodeSigning.xcconfig"
2022

23+
PRODUCT_NAME = SideBackup
24+
25+
INFOPLIST_FILE = $(PRODUCT_NAME)/Info.plist
26+
CODE_SIGN_ENTITLEMENTS = $(PRODUCT_NAME)/$(PRODUCT_NAME).entitlements
27+
28+
PRODUCT_BUNDLE_IDENTIFIER[config=*] = $(ORG).$(DEVELOPMENT_TEAM).$(PRODUCT_NAME)
29+
// we set without a Team ID when archiving
30+
PRODUCT_BUNDLE_IDENTIFIER[config=Archive] = $(ORG).$(PRODUCT_NAME)
31+
32+
GROUP_ID = com.SideStore.SideStore.$(DEVELOPMENT_TEAM)
33+
ALT_GROUP_ID = com.rileytestut.AltStore.$(DEVELOPMENT_TEAM)
34+
GROUP_ID[config=Archive] = com.SideStore.SideStore
35+
ALT_GROUP_ID[config=Archive] = com.rileytestut.AltStore
36+
37+
EXTENSION_PREFIX = $(PRODUCT_BUNDLE_IDENTIFIER)
38+
ICLOUD_CONTAINER_IDENTIFIER = iCloud.$(ORG).$(PRODUCT_NAME)
39+
2140
SWIFT_VERSION = 6.0
2241

2342
SDKROOT = iphoneos
@@ -28,6 +47,7 @@ TARGETED_DEVICE_FAMILY = 1,2
2847
GENERATE_INFOPLIST_FILE = YES
2948
STRING_CATALOG_GENERATE_SYMBOLS = YES
3049
SWIFT_EMIT_LOC_STRINGS = YES
50+
MERGED_BINARY_TYPE = automatic
3151

3252
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon
3353
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor
@@ -44,24 +64,8 @@ INFOPLIST_KEY_UILaunchScreen_Generation = YES
4464
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES
4565
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES
4666

47-
ORIENTATIONS = UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight
48-
INFOPLIST_KEY_UISupportedInterfaceOrientations = $(ORIENTATIONS)
49-
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = $(ORIENTATIONS)
50-
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = $(ORIENTATIONS)
51-
52-
ORG_PREFIX = $(ORG_IDENTIFIER)
53-
54-
PRODUCT_NAME = SideBackup
55-
INFOPLIST_FILE = SideBackup/Info.plist
56-
57-
PRODUCT_BUNDLE_IDENTIFIER = $(ORG_IDENTIFIER).$(DEVELOPMENT_TEAM).$(PRODUCT_NAME)
58-
PRODUCT_BUNDLE_IDENTIFIER[config=Archive] = $(ORG_IDENTIFIER).$(PRODUCT_NAME)
59-
60-
GROUP_ID = $(ORG_IDENTIFIER).$(DEVELOPMENT_TEAM)
61-
62-
EXTENSION_PREFIX = $(PRODUCT_BUNDLE_IDENTIFIER)
63-
APP_GROUP_IDENTIFIER = $(GROUP_ID)
64-
ICLOUD_CONTAINER_IDENTIFIER = iCloud.$(ORG_PREFIX).$(PRODUCT_NAME)
67+
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = UIInterfaceOrientationPortrait
68+
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight
6569

6670
// Suppress noise from os activity in xcode console log for release builds
6771
DEBUG_ACTIVITY_MODE = disable

‎SideBackup.xcodeproj/project.pbxproj‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@
156156
baseConfigurationReference = 0E1E90132F2274D40085F43D /* Build.xcconfig */;
157157
buildSettings = {
158158
ALWAYS_SEARCH_USER_PATHS = NO;
159-
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
160159
CLANG_ANALYZER_NONNULL = YES;
161160
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
162161
CLANG_ENABLE_MODULES = YES;
@@ -188,8 +187,6 @@
188187
ENABLE_STRICT_OBJC_MSGSEND = YES;
189188
ENABLE_TESTABILITY = YES;
190189
ENABLE_USER_SCRIPT_SANDBOXING = YES;
191-
GCC_DYNAMIC_NO_PIC = NO;
192-
GCC_NO_COMMON_BLOCKS = YES;
193190
GCC_OPTIMIZATION_LEVEL = 0;
194191
GCC_PREPROCESSOR_DEFINITIONS = (
195192
"DEBUG=1",
@@ -214,7 +211,6 @@
214211
baseConfigurationReference = 0E1E90132F2274D40085F43D /* Build.xcconfig */;
215212
buildSettings = {
216213
ALWAYS_SEARCH_USER_PATHS = NO;
217-
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
218214
CLANG_ANALYZER_NONNULL = YES;
219215
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
220216
CLANG_ENABLE_MODULES = YES;
@@ -246,7 +242,6 @@
246242
ENABLE_NS_ASSERTIONS = NO;
247243
ENABLE_STRICT_OBJC_MSGSEND = YES;
248244
ENABLE_USER_SCRIPT_SANDBOXING = YES;
249-
GCC_NO_COMMON_BLOCKS = YES;
250245
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
251246
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
252247
GCC_WARN_UNDECLARED_SELECTOR = YES;
@@ -256,7 +251,6 @@
256251
MTL_ENABLE_DEBUG_INFO = NO;
257252
MTL_FAST_MATH = YES;
258253
SWIFT_COMPILATION_MODE = wholemodule;
259-
VALIDATE_PRODUCT = YES;
260254
};
261255
name = Release;
262256
};
@@ -277,7 +271,6 @@
277271
baseConfigurationReference = 0E1E90132F2274D40085F43D /* Build.xcconfig */;
278272
buildSettings = {
279273
ALWAYS_SEARCH_USER_PATHS = NO;
280-
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
281274
CLANG_ANALYZER_NONNULL = YES;
282275
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
283276
CLANG_ENABLE_MODULES = YES;
@@ -310,7 +303,7 @@
310303
ENABLE_NS_ASSERTIONS = NO;
311304
ENABLE_STRICT_OBJC_MSGSEND = YES;
312305
ENABLE_USER_SCRIPT_SANDBOXING = YES;
313-
GCC_NO_COMMON_BLOCKS = YES;
306+
GCC_OPTIMIZATION_LEVEL = z;
314307
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
315308
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
316309
GCC_WARN_UNDECLARED_SELECTOR = YES;
@@ -320,7 +313,6 @@
320313
MTL_ENABLE_DEBUG_INFO = NO;
321314
MTL_FAST_MATH = YES;
322315
SWIFT_COMPILATION_MODE = wholemodule;
323-
VALIDATE_PRODUCT = YES;
324316
};
325317
name = Archive;
326318
};

‎SideBackup/Assets.xcassets/AccentColor.colorset/Contents.json‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
{
22
"colors" : [
33
{
4+
"color" : {
5+
"color-space" : "display-p3",
6+
"components" : {
7+
"alpha" : "1.000",
8+
"blue" : "0.923",
9+
"green" : "0.164",
10+
"red" : "0.512"
11+
}
12+
},
413
"idiom" : "universal"
514
}
615
],

‎SideBackup/Assets.xcassets/AppIcon.appiconset/Contents.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"images" : [
33
{
4-
"filename" : "sidebackup.png",
4+
"filename" : "sideback.png",
55
"idiom" : "universal",
66
"platform" : "ios",
77
"size" : "1024x1024"
251 KB
Loading
-867 KB
Binary file not shown.

‎SideBackup/ContentView.swift‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,24 @@ struct ContentView: View {
6262
}
6363
}
6464
.padding()
65+
.onAppear {
66+
URL.groupContainers.forEach { id, url in
67+
print("\(id): \(url.path)")
68+
let fm: FileManager = .default
69+
var allFiles: Set<URL> = []
70+
if let files = fm.enumerator(atPath: url.path) {
71+
for case let f as String in files {
72+
let file = URL(file: f, relative: url)
73+
allFiles.insert(file)
74+
}
75+
}
76+
allFiles.forEach { print($0.relativeString) }
77+
}
78+
print(URL.groupContainers)
79+
}
80+
.onOpenURL { url in
81+
print(url)
82+
}
6583
}
6684
}
6785

0 commit comments

Comments
 (0)