Compare commits
1 Commits
ios-v1.0.3
...
2efad547b5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2efad547b5 |
@@ -6,8 +6,8 @@ on:
|
||||
- "ios-v*"
|
||||
|
||||
concurrency:
|
||||
group: ios-macos-runner
|
||||
cancel-in-progress: false
|
||||
group: ${{ gitea.workflow }}-${{ gitea.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
# ── archive & release to TestFlight ──────────────────────────────────────
|
||||
@@ -28,28 +28,14 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Ruby with rbenv
|
||||
run: |
|
||||
# Install rbenv and ruby-build if not already installed
|
||||
brew install rbenv ruby-build || true
|
||||
|
||||
# Install Ruby 3.2.2
|
||||
rbenv install 3.2.2 --skip-existing
|
||||
rbenv global 3.2.2
|
||||
|
||||
# Add rbenv to PATH for subsequent steps
|
||||
echo "$(rbenv root)/shims" >> $GITHUB_PATH
|
||||
|
||||
# Verify Ruby version
|
||||
eval "$(rbenv init -)"
|
||||
ruby --version
|
||||
- name: Install just
|
||||
run: command -v just || brew install just
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: ios/LibNovel
|
||||
- name: Set build number from run number
|
||||
run: |
|
||||
eval "$(rbenv init -)"
|
||||
gem install bundler
|
||||
bundle install
|
||||
sed -i '' \
|
||||
's/CURRENT_PROJECT_VERSION: .*/CURRENT_PROJECT_VERSION: ${{ gitea.run_number }}/' \
|
||||
ios/LibNovel/project.yml
|
||||
|
||||
- name: Import signing certificate
|
||||
env:
|
||||
@@ -66,8 +52,7 @@ jobs:
|
||||
-P "$CERTIFICATE_PASSWORD" \
|
||||
-A -t cert -f pkcs12 \
|
||||
-k $KEYCHAIN_PATH
|
||||
security list-keychain -d user -s $KEYCHAIN_PATH $(security list-keychains -d user | tr -d '"' | xargs)
|
||||
security set-key-partition-list -S apple-tool:,apple: -s -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
|
||||
security list-keychain -d user -s $KEYCHAIN_PATH
|
||||
|
||||
- name: Import provisioning profile
|
||||
env:
|
||||
@@ -75,30 +60,54 @@ jobs:
|
||||
run: |
|
||||
PP_PATH=$RUNNER_TEMP/profile.mobileprovision
|
||||
echo "$PROFILE_BASE64" | base64 --decode > $PP_PATH
|
||||
UUID=$(security cms -D -i "$PP_PATH" | plutil -extract UUID raw -)
|
||||
PROFILE_NAME=$(security cms -D -i "$PP_PATH" | plutil -extract Name raw -)
|
||||
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
|
||||
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles/$UUID.mobileprovision
|
||||
echo "Installed profile: $PROFILE_NAME (UUID: $UUID)"
|
||||
echo "PROFILE_NAME=$PROFILE_NAME" >> $GITHUB_ENV
|
||||
echo "PROFILE_UUID=$UUID" >> $GITHUB_ENV
|
||||
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles/
|
||||
|
||||
- name: Build and upload to TestFlight
|
||||
- name: Write App Store Connect API key
|
||||
env:
|
||||
ASC_PRIVATE_KEY: ${{ secrets.ASC_PRIVATE_KEY }}
|
||||
ASC_KEY_ID: ${{ secrets.ASC_KEY_ID }}
|
||||
run: |
|
||||
mkdir -p ~/private_keys
|
||||
echo "$ASC_PRIVATE_KEY" > ~/private_keys/AuthKey_$ASC_KEY_ID.p8
|
||||
|
||||
- name: Inject team ID into ExportOptions.plist
|
||||
env:
|
||||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||
run: |
|
||||
/usr/libexec/PlistBuddy -c \
|
||||
"Set :teamID $APPLE_TEAM_ID" \
|
||||
ios/LibNovel/ExportOptions.plist
|
||||
|
||||
- name: Archive
|
||||
env:
|
||||
USER: runner
|
||||
LC_ALL: en_US.UTF-8
|
||||
LANG: en_US.UTF-8
|
||||
APPLE_KEY_ID: ${{ secrets.ASC_KEY_ID }}
|
||||
APPLE_ISSUER_ID: ${{ secrets.ASC_ISSUER_ID }}
|
||||
APPLE_KEY_CONTENT: ${{ secrets.ASC_PRIVATE_KEY }}
|
||||
BUILD_NUMBER: ${{ gitea.run_number }}
|
||||
working-directory: ios/LibNovel
|
||||
run: just ios-archive
|
||||
|
||||
- name: Export IPA
|
||||
run: |
|
||||
eval "$(rbenv init -)"
|
||||
echo "Using provisioning profile: $PROFILE_NAME (UUID: $PROFILE_UUID)"
|
||||
export PROVISIONING_PROFILE_NAME="$PROFILE_NAME"
|
||||
export PROVISIONING_PROFILE_UUID="$PROFILE_UUID"
|
||||
bundle exec fastlane beta
|
||||
xcodebuild -exportArchive \
|
||||
-archivePath $RUNNER_TEMP/LibNovel.xcarchive \
|
||||
-exportPath $RUNNER_TEMP/ipa \
|
||||
-exportOptionsPlist ios/LibNovel/ExportOptions.plist
|
||||
|
||||
- name: Upload to TestFlight
|
||||
env:
|
||||
ASC_KEY_ID: ${{ secrets.ASC_KEY_ID }}
|
||||
ASC_ISSUER_ID: ${{ secrets.ASC_ISSUER_ID }}
|
||||
run: |
|
||||
xcrun altool --upload-app \
|
||||
--type ios \
|
||||
--file $RUNNER_TEMP/ipa/LibNovel.ipa \
|
||||
--apiKey "$ASC_KEY_ID" \
|
||||
--apiIssuer "$ASC_ISSUER_ID"
|
||||
|
||||
- name: Upload IPA artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: LibNovel-${{ gitea.ref_name }}.ipa
|
||||
path: ${{ env.RUNNER_TEMP }}/ipa/LibNovel.ipa
|
||||
retention-days: 30
|
||||
|
||||
- name: Cleanup keychain
|
||||
if: always()
|
||||
|
||||
@@ -17,7 +17,7 @@ on:
|
||||
- ".gitea/workflows/ios-release.yaml"
|
||||
|
||||
concurrency:
|
||||
group: ios-macos-runner
|
||||
group: ${{ gitea.workflow }}-${{ gitea.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
|
||||
10
ios/LibNovel/.gitignore
vendored
10
ios/LibNovel/.gitignore
vendored
@@ -1,10 +0,0 @@
|
||||
# Fastlane
|
||||
fastlane/report.xml
|
||||
fastlane/Preview.html
|
||||
fastlane/screenshots/**/*.png
|
||||
fastlane/test_output
|
||||
fastlane/README.md
|
||||
|
||||
# Bundler
|
||||
.bundle
|
||||
vendor/bundle
|
||||
@@ -14,7 +14,7 @@
|
||||
<string>manual</string>
|
||||
<key>provisioningProfiles</key>
|
||||
<dict>
|
||||
<key>com.kalekber.LibNovel</key>
|
||||
<key>cc.kalekber.libnovel</key>
|
||||
<string>LibNovel Distribution</string>
|
||||
</dict>
|
||||
</dict>
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
source "https://rubygems.org"
|
||||
|
||||
gem "fastlane"
|
||||
@@ -1,47 +0,0 @@
|
||||
default_platform(:ios)
|
||||
|
||||
platform :ios do
|
||||
desc "Build and upload to TestFlight"
|
||||
lane :beta do
|
||||
# Generate Xcode project from project.yml (one level up from fastlane/)
|
||||
sh("cd .. && xcodegen generate --spec project.yml --project .")
|
||||
|
||||
# Set build number from CI run number (passed as env var)
|
||||
increment_build_number(
|
||||
build_number: ENV["BUILD_NUMBER"] || "1",
|
||||
xcodeproj: "LibNovel.xcodeproj"
|
||||
)
|
||||
|
||||
# Enable manual code signing with specific provisioning profile UUID
|
||||
# Using UUID instead of name because Xcode expects TEAM_ID/Name format for names
|
||||
update_code_signing_settings(
|
||||
use_automatic_signing: false,
|
||||
team_id: "GHZXC6FVMU",
|
||||
targets: ["LibNovel"],
|
||||
path: "LibNovel.xcodeproj",
|
||||
profile_uuid: ENV["PROVISIONING_PROFILE_UUID"] || "af592c3a-f60b-4ac1-a14f-30b8a206017f",
|
||||
code_sign_identity: "Apple Distribution"
|
||||
)
|
||||
|
||||
# Build the app with manual signing
|
||||
build_app(
|
||||
scheme: "LibNovel",
|
||||
export_method: "app-store",
|
||||
clean: true,
|
||||
configuration: "Release",
|
||||
export_options: {
|
||||
method: "app-store",
|
||||
teamID: "GHZXC6FVMU",
|
||||
provisioningProfiles: {
|
||||
"com.kalekber.LibNovel" => ENV["PROVISIONING_PROFILE_NAME"] || "LibNovel Distribution"
|
||||
},
|
||||
signingStyle: "manual"
|
||||
}
|
||||
)
|
||||
|
||||
# Upload to TestFlight
|
||||
upload_to_testflight(
|
||||
skip_waiting_for_build_processing: true
|
||||
)
|
||||
end
|
||||
end
|
||||
@@ -1,6 +1,6 @@
|
||||
name: LibNovel
|
||||
options:
|
||||
bundleIdPrefix: com.kalekber
|
||||
bundleIdPrefix: cc.kalekber
|
||||
deploymentTarget:
|
||||
iOS: "17.0"
|
||||
xcodeVersion: "16.0"
|
||||
@@ -44,15 +44,11 @@ targets:
|
||||
- package: Kingfisher
|
||||
settings:
|
||||
base:
|
||||
PRODUCT_BUNDLE_IDENTIFIER: com.kalekber.LibNovel
|
||||
PRODUCT_BUNDLE_IDENTIFIER: cc.kalekber.libnovel
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon
|
||||
TARGETED_DEVICE_FAMILY: "1,2" # iPhone + iPad
|
||||
GENERATE_INFOPLIST_FILE: NO
|
||||
INFOPLIST_FILE: LibNovel/Resources/Info.plist
|
||||
configs:
|
||||
Release:
|
||||
CODE_SIGN_STYLE: Manual
|
||||
DEVELOPMENT_TEAM: GHZXC6FVMU
|
||||
|
||||
LibNovelTests:
|
||||
type: bundle.unit-test
|
||||
@@ -64,7 +60,7 @@ targets:
|
||||
- target: LibNovel
|
||||
settings:
|
||||
base:
|
||||
PRODUCT_BUNDLE_IDENTIFIER: com.kalekber.LibNovel.tests
|
||||
PRODUCT_BUNDLE_IDENTIFIER: cc.kalekber.libnovel.tests
|
||||
|
||||
schemes:
|
||||
LibNovel:
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Test script for local iOS build iteration
|
||||
# Run from ios/LibNovel directory
|
||||
|
||||
echo "=== Generating Xcode project ==="
|
||||
xcodegen generate --spec project.yml --project .
|
||||
|
||||
echo ""
|
||||
echo "=== Listing available provisioning profiles ==="
|
||||
ls -la ~/Library/MobileDevice/Provisioning\ Profiles/ || echo "No profiles found"
|
||||
|
||||
echo ""
|
||||
echo "=== Listing available signing identities ==="
|
||||
security find-identity -v -p codesigning
|
||||
|
||||
echo ""
|
||||
echo "=== Attempting archive build ==="
|
||||
xcodebuild archive \
|
||||
-project LibNovel.xcodeproj \
|
||||
-scheme LibNovel \
|
||||
-configuration Release \
|
||||
-destination 'generic/platform=iOS' \
|
||||
-archivePath ./build/LibNovel.xcarchive \
|
||||
-allowProvisioningUpdates \
|
||||
CODE_SIGN_STYLE=Manual \
|
||||
CODE_SIGN_IDENTITY="Apple Distribution" \
|
||||
DEVELOPMENT_TEAM="GHZXC6FVMU"
|
||||
|
||||
echo ""
|
||||
echo "=== Build succeeded! ==="
|
||||
9
justfile
9
justfile
@@ -130,18 +130,13 @@ ios-test: ios-gen ios-resolve
|
||||
# Archive a signed Release build (requires valid signing identity in keychain).
|
||||
# Output: {{runner_temp}}/LibNovel.xcarchive
|
||||
# Typically called from CI after importing certificate + provisioning profile.
|
||||
# Usage: just ios-archive <team-id> <profile-uuid>
|
||||
ios-archive team_id profile_uuid: ios-gen ios-resolve
|
||||
ios-archive: ios-gen ios-resolve
|
||||
cd {{ios_dir}} && xcodebuild archive \
|
||||
-project {{ios_scheme}}.xcodeproj \
|
||||
-scheme {{ios_scheme}} \
|
||||
-configuration Release \
|
||||
-destination 'generic/platform=iOS' \
|
||||
-clonedSourcePackagesDirPath {{ios_spm}} \
|
||||
-archivePath {{runner_temp}}/LibNovel.xcarchive \
|
||||
CODE_SIGN_IDENTITY="Apple Distribution" \
|
||||
"PROVISIONING_PROFILE[sdk=iphoneos*]={{profile_uuid}}" \
|
||||
DEVELOPMENT_TEAM="{{team_id}}"
|
||||
-archivePath {{runner_temp}}/LibNovel.xcarchive
|
||||
|
||||
# Export an IPA from the archive produced by ios-archive.
|
||||
# Requires ios/LibNovel/ExportOptions.plist.
|
||||
|
||||
Reference in New Issue
Block a user