chore(build): migrate to SwiftPM + xTool, add AltStore/SideStore pipeline
- Replace XcodeGen project.yml with Package.swift (SwiftPM) - Add xtool.yml for xTool cross-platform build configuration - Add .gitea/workflows/release.yml — builds IPA on tagged release via self-hosted macOS runner, uploads to Gitea releases, auto-updates source - Add altstore-source.json — dual-compatible with AltStore and SideStore (top-level downloadURL, ISO 8601 dates, SilverLABS branding) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
92
.gitea/workflows/release.yml
Normal file
92
.gitea/workflows/release.yml
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
name: Release IPA
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "v*"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build & Publish IPA
|
||||||
|
runs-on: [self-hosted, macos]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install xTool
|
||||||
|
run: |
|
||||||
|
if ! command -v xtool &> /dev/null; then
|
||||||
|
curl -fsSL https://xtool.sh/install.sh | bash
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Extract version from tag
|
||||||
|
id: version
|
||||||
|
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Build IPA
|
||||||
|
env:
|
||||||
|
XTOOL_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||||
|
XTOOL_APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||||
|
XTOOL_APP_PASSWORD: ${{ secrets.APPLE_APP_PASSWORD }}
|
||||||
|
run: |
|
||||||
|
xtool archive \
|
||||||
|
--scheme SilverApple \
|
||||||
|
--output SilverApple.ipa
|
||||||
|
|
||||||
|
- name: Compute SHA-256
|
||||||
|
id: sha
|
||||||
|
run: echo "SHA256=$(shasum -a 256 SilverApple.ipa | awk '{print $1}')" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Get IPA size (bytes)
|
||||||
|
id: size
|
||||||
|
run: echo "SIZE=$(wc -c < SilverApple.ipa | tr -d ' ')" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Update altstore-source.json
|
||||||
|
run: |
|
||||||
|
DOWNLOAD_URL="https://git.silverlabs.uk/${{ github.repository }}/releases/download/${{ github.ref_name }}/SilverApple.ipa"
|
||||||
|
DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
||||||
|
VERSION="${{ steps.version.outputs.VERSION }}"
|
||||||
|
SHA256="${{ steps.sha.outputs.SHA256 }}"
|
||||||
|
SIZE="${{ steps.size.outputs.SIZE }}"
|
||||||
|
|
||||||
|
# Update top-level downloadURL (required by SideStore) and prepend new version entry
|
||||||
|
jq --arg version "$VERSION" \
|
||||||
|
--arg date "$DATE" \
|
||||||
|
--arg url "$DOWNLOAD_URL" \
|
||||||
|
--arg sha "$SHA256" \
|
||||||
|
--argjson size "$SIZE" \
|
||||||
|
'.apps[0].downloadURL = $url |
|
||||||
|
.apps[0].versions = [{"version": $version, "buildVersion": $version, "date": $date,
|
||||||
|
"localizedDescription": "See release notes.", "downloadURL": $url,
|
||||||
|
"sha256": $sha, "size": $size}] + .apps[0].versions' \
|
||||||
|
altstore-source.json > altstore-source.tmp.json
|
||||||
|
mv altstore-source.tmp.json altstore-source.json
|
||||||
|
|
||||||
|
- name: Commit updated AltStore source
|
||||||
|
run: |
|
||||||
|
git config user.name "Gitea Actions"
|
||||||
|
git config user.email "actions@silverlabs.uk"
|
||||||
|
git add altstore-source.json
|
||||||
|
git commit -m "chore(altstore): update source for ${{ github.ref_name }}" || echo "No changes to commit"
|
||||||
|
git push origin HEAD:main
|
||||||
|
|
||||||
|
- name: Create Gitea release and upload IPA
|
||||||
|
env:
|
||||||
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
run: |
|
||||||
|
TAG="${{ github.ref_name }}"
|
||||||
|
REPO="${{ github.repository }}"
|
||||||
|
API="https://git.silverlabs.uk/api/v1"
|
||||||
|
|
||||||
|
# Create release
|
||||||
|
RELEASE_ID=$(curl -s -X POST "$API/repos/$REPO/releases" \
|
||||||
|
-H "Authorization: token $GITEA_TOKEN" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "{\"tag_name\":\"$TAG\",\"name\":\"SilverApple $TAG\",\"body\":\"AltStore release $TAG\",\"draft\":false,\"prerelease\":false}" \
|
||||||
|
| jq -r '.id')
|
||||||
|
|
||||||
|
# Upload IPA asset
|
||||||
|
curl -s -X POST "$API/repos/$REPO/releases/$RELEASE_ID/assets" \
|
||||||
|
-H "Authorization: token $GITEA_TOKEN" \
|
||||||
|
-F "attachment=@SilverApple.ipa;type=application/octet-stream"
|
||||||
32
Package.swift
Normal file
32
Package.swift
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
// swift-tools-version: 5.9
|
||||||
|
import PackageDescription
|
||||||
|
|
||||||
|
let package = Package(
|
||||||
|
name: "SilverApple",
|
||||||
|
platforms: [
|
||||||
|
.iOS(.v16)
|
||||||
|
],
|
||||||
|
targets: [
|
||||||
|
.executableTarget(
|
||||||
|
name: "SilverApple",
|
||||||
|
path: "SilverApple",
|
||||||
|
exclude: [
|
||||||
|
"Info.plist",
|
||||||
|
"SilverApple.entitlements",
|
||||||
|
],
|
||||||
|
resources: [
|
||||||
|
.process("Assets.xcassets"),
|
||||||
|
],
|
||||||
|
linkerSettings: [
|
||||||
|
.linkedFramework("AuthenticationServices"),
|
||||||
|
.linkedFramework("SafariServices"),
|
||||||
|
.linkedFramework("Security"),
|
||||||
|
]
|
||||||
|
),
|
||||||
|
.testTarget(
|
||||||
|
name: "SilverAppleTests",
|
||||||
|
dependencies: ["SilverApple"],
|
||||||
|
path: "SilverAppleTests"
|
||||||
|
),
|
||||||
|
]
|
||||||
|
)
|
||||||
24
altstore-source.json
Normal file
24
altstore-source.json
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"name": "SilverLABS",
|
||||||
|
"identifier": "uk.silverlabs.source",
|
||||||
|
"subtitle": "Privacy-first apps by SilverLABS",
|
||||||
|
"description": "SilverLABS app distribution — compatible with AltStore and SideStore.",
|
||||||
|
"iconURL": "https://git.silverlabs.uk/SilverLABS/SilverApple/raw/branch/main/SilverApple/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png",
|
||||||
|
"website": "https://silverlabs.uk",
|
||||||
|
"tintColor": "00BBFF",
|
||||||
|
"apps": [
|
||||||
|
{
|
||||||
|
"name": "SilverApple",
|
||||||
|
"bundleIdentifier": "uk.silverlabs.silverapple",
|
||||||
|
"developerName": "SilverLABS",
|
||||||
|
"downloadURL": "",
|
||||||
|
"subtitle": "Privacy companion for iOS",
|
||||||
|
"localizedDescription": "SilverApple integrates your device with the SilverLABS ecosystem — MDM enrollment, privacy hardening checks, and Passport authentication.",
|
||||||
|
"iconURL": "https://git.silverlabs.uk/SilverLABS/SilverApple/raw/branch/main/SilverApple/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png",
|
||||||
|
"tintColor": "00BBFF",
|
||||||
|
"category": "utilities",
|
||||||
|
"versions": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"news": []
|
||||||
|
}
|
||||||
50
project.yml
50
project.yml
@@ -1,50 +0,0 @@
|
|||||||
name: SilverApple
|
|
||||||
|
|
||||||
options:
|
|
||||||
bundleIdPrefix: uk.silverlabs
|
|
||||||
deploymentTarget:
|
|
||||||
iOS: "16.0"
|
|
||||||
xcodeVersion: "15.0"
|
|
||||||
createIntermediateGroups: true
|
|
||||||
groupSortPosition: top
|
|
||||||
|
|
||||||
settings:
|
|
||||||
base:
|
|
||||||
SWIFT_VERSION: "5.9"
|
|
||||||
DEVELOPMENT_TEAM: "" # Fill in your Apple Developer Team ID before building
|
|
||||||
CODE_SIGN_STYLE: Automatic
|
|
||||||
ENABLE_BITCODE: false
|
|
||||||
|
|
||||||
targets:
|
|
||||||
SilverApple:
|
|
||||||
type: application
|
|
||||||
platform: iOS
|
|
||||||
deploymentTarget: "16.0"
|
|
||||||
sources:
|
|
||||||
- path: SilverApple
|
|
||||||
settings:
|
|
||||||
base:
|
|
||||||
PRODUCT_BUNDLE_IDENTIFIER: uk.silverlabs.silverapple
|
|
||||||
INFOPLIST_FILE: SilverApple/Info.plist
|
|
||||||
CODE_SIGN_ENTITLEMENTS: SilverApple/SilverApple.entitlements
|
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon
|
|
||||||
TARGETED_DEVICE_FAMILY: "1" # iPhone only
|
|
||||||
dependencies:
|
|
||||||
- framework: AuthenticationServices.framework
|
|
||||||
embed: false
|
|
||||||
- framework: SafariServices.framework
|
|
||||||
embed: false
|
|
||||||
- framework: Security.framework
|
|
||||||
embed: false
|
|
||||||
|
|
||||||
SilverAppleTests:
|
|
||||||
type: bundle.unit-test
|
|
||||||
platform: iOS
|
|
||||||
deploymentTarget: "16.0"
|
|
||||||
sources:
|
|
||||||
- path: SilverAppleTests
|
|
||||||
settings:
|
|
||||||
base:
|
|
||||||
PRODUCT_BUNDLE_IDENTIFIER: uk.silverlabs.silverapple.tests
|
|
||||||
dependencies:
|
|
||||||
- target: SilverApple
|
|
||||||
13
xtool.yml
Normal file
13
xtool.yml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# xTool configuration — https://xtool.sh
|
||||||
|
# Run `xtool configure` once to set up your Apple ID credentials and Darwin SDK.
|
||||||
|
# Then: `xtool run` to build and install directly to a connected device.
|
||||||
|
|
||||||
|
targets:
|
||||||
|
SilverApple:
|
||||||
|
bundleIdentifier: uk.silverlabs.silverapple
|
||||||
|
# Fill in your Apple Developer Team ID (10-char string from developer.apple.com)
|
||||||
|
teamID: ""
|
||||||
|
infoPlist: SilverApple/Info.plist
|
||||||
|
entitlements: SilverApple/SilverApple.entitlements
|
||||||
|
deploymentTarget: "16.0"
|
||||||
|
deviceFamily: [iphone]
|
||||||
Reference in New Issue
Block a user