Private
Public Access
1
0
Files
SilverApple/codemagic.yaml
SilverLABS e3359320fc fix(ci): correct Gitea HTTP auth username in codemagic push step
Was using 'sysadmin' (Linux system user) instead of 'SilverLABS' (Gitea account).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-05 12:50:25 +01:00

91 lines
3.4 KiB
YAML

workflows:
ios-release:
name: SilverApple iOS Release
instance_type: mac_mini_m2
max_build_duration: 30
triggering:
events:
- tag
tag_patterns:
- pattern: 'v*'
include: true
environment:
xcode: latest
vars:
BUNDLE_ID: uk.silverlabs.silverapple
GITEA_REPO: SilverLABS/SilverApple
GITEA_API: https://git.silverlabs.uk/api/v1
# GITEA_TOKEN — set this in Codemagic App Settings → Environment variables (mark as secret)
scripts:
- name: Build archive (unsigned)
script: |
xcodebuild archive \
-scheme SilverApple \
-destination "generic/platform=iOS" \
-archivePath "$CM_BUILD_DIR/SilverApple.xcarchive" \
CODE_SIGNING_ALLOWED=NO \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGN_IDENTITY="" \
PROVISIONING_PROFILE=""
- name: Package IPA
script: |
cd "$CM_BUILD_DIR"
mkdir -p Payload
cp -r SilverApple.xcarchive/Products/Applications/SilverApple.app Payload/
zip -r SilverApple.ipa Payload/
rm -rf Payload
echo "IPA size: $(du -sh SilverApple.ipa | cut -f1)"
- name: Publish to Gitea
script: |
set -e
TAG="$CM_TAG"
VERSION="${TAG#v}"
IPA="$CM_BUILD_DIR/SilverApple.ipa"
SHA256=$(shasum -a 256 "$IPA" | awk '{print $1}')
SIZE=$(wc -c < "$IPA" | tr -d ' ')
DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
DOWNLOAD_URL="https://git.silverlabs.uk/$GITEA_REPO/releases/download/$TAG/SilverApple.ipa"
# Update altstore-source.json
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
# Commit and push updated source
git remote set-url origin "https://SilverLABS:$GITEA_TOKEN@git.silverlabs.uk/$GITEA_REPO.git"
git config user.name "Codemagic"
git config user.email "ci@silverlabs.uk"
git add altstore-source.json
git commit -m "chore(altstore): update source for $TAG" || echo "No changes"
git push origin HEAD:main
# Create Gitea release
RELEASE_ID=$(curl -sf -X POST "$GITEA_API/repos/$GITEA_REPO/releases" \
-H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"tag_name\":\"$TAG\",\"name\":\"SilverApple $TAG\",\"body\":\"AltStore / SideStore release.\",\"draft\":false,\"prerelease\":false}" \
| jq -r '.id')
# Upload IPA
curl -sf -X POST "$GITEA_API/repos/$GITEA_REPO/releases/$RELEASE_ID/assets" \
-H "Authorization: token $GITEA_TOKEN" \
-F "attachment=@$IPA;type=application/octet-stream"
echo "Published release $TAG → $DOWNLOAD_URL"
artifacts:
- $CM_BUILD_DIR/SilverApple.ipa