Add iOS app, SvelteKit JSON API endpoints, and Gitea CI workflow
Some checks failed
Deploy / Deploy Production (push) Has been skipped
Deploy / Cleanup Preview (push) Has been skipped
Deploy / Deploy Preview (push) Failing after 0s
CI / Scraper / Test (pull_request) Successful in 11s
CI / UI / Build (pull_request) Failing after 14s
CI / Scraper / Lint (pull_request) Successful in 23s
CI / Scraper / Build (pull_request) Successful in 24s
iOS CI / Build (push) Has been cancelled
iOS CI / Test (push) Has been cancelled
iOS CI / Build (pull_request) Failing after 2s
iOS CI / Test (pull_request) Has been skipped
Some checks failed
Deploy / Deploy Production (push) Has been skipped
Deploy / Cleanup Preview (push) Has been skipped
Deploy / Deploy Preview (push) Failing after 0s
CI / Scraper / Test (pull_request) Successful in 11s
CI / UI / Build (pull_request) Failing after 14s
CI / Scraper / Lint (pull_request) Successful in 23s
CI / Scraper / Build (pull_request) Successful in 24s
iOS CI / Build (push) Has been cancelled
iOS CI / Test (push) Has been cancelled
iOS CI / Build (pull_request) Failing after 2s
iOS CI / Test (pull_request) Has been skipped
- iOS SwiftUI app (ios/LibNovel/) targeting iOS 17+, generated via xcodegen - Full feature set: auth, home, library, book detail, chapter reader, browse, audio player, profile - Kingfisher for image loading, swift-markdown-ui for chapter rendering - Base URL: https://v2.libnovel.kalekber.cc - SvelteKit JSON API routes (ui/src/routes/api/) for iOS consumption: auth/login, auth/register, auth/me, auth/logout, auth/change-password, home, library, book/[slug], chapter/[slug]/[n], search, ranking, progress/[slug], presign/audio (updated) - Gitea Actions CI: .gitea/workflows/ios.yaml (build + test on macos-latest) - justfile: ios-gen, ios-build, ios-test recipes
This commit is contained in:
169
.gitea/workflows/ios.yaml
Normal file
169
.gitea/workflows/ios.yaml
Normal file
@@ -0,0 +1,169 @@
|
||||
name: iOS CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["v2", "main"]
|
||||
paths:
|
||||
- "ios/**"
|
||||
- ".gitea/workflows/ios.yaml"
|
||||
pull_request:
|
||||
branches: ["v2", "main"]
|
||||
paths:
|
||||
- "ios/**"
|
||||
- ".gitea/workflows/ios.yaml"
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ios/LibNovel
|
||||
|
||||
jobs:
|
||||
# ── build ─────────────────────────────────────────────────────────────────
|
||||
build:
|
||||
name: Build
|
||||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install xcodegen
|
||||
run: brew install xcodegen
|
||||
|
||||
- name: Generate Xcode project
|
||||
run: xcodegen generate --spec project.yml --project .
|
||||
|
||||
- name: Resolve SPM packages
|
||||
run: |
|
||||
xcodebuild \
|
||||
-project LibNovel.xcodeproj \
|
||||
-scheme LibNovel \
|
||||
-resolvePackageDependencies \
|
||||
-clonedSourcePackagesDirPath .spm-cache
|
||||
|
||||
- name: Build (simulator)
|
||||
run: |
|
||||
xcodebuild \
|
||||
-project LibNovel.xcodeproj \
|
||||
-scheme LibNovel \
|
||||
-configuration Debug \
|
||||
-destination 'generic/platform=iOS Simulator' \
|
||||
-clonedSourcePackagesDirPath .spm-cache \
|
||||
CODE_SIGNING_ALLOWED=NO \
|
||||
| xcpretty || xcodebuild \
|
||||
-project LibNovel.xcodeproj \
|
||||
-scheme LibNovel \
|
||||
-configuration Debug \
|
||||
-destination 'generic/platform=iOS Simulator' \
|
||||
-clonedSourcePackagesDirPath .spm-cache \
|
||||
CODE_SIGNING_ALLOWED=NO
|
||||
|
||||
# ── test ──────────────────────────────────────────────────────────────────
|
||||
test:
|
||||
name: Test
|
||||
runs-on: macos-latest
|
||||
needs: build
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install xcodegen
|
||||
run: brew install xcodegen
|
||||
|
||||
- name: Generate Xcode project
|
||||
run: xcodegen generate --spec project.yml --project .
|
||||
|
||||
- name: Resolve SPM packages
|
||||
run: |
|
||||
xcodebuild \
|
||||
-project LibNovel.xcodeproj \
|
||||
-scheme LibNovel \
|
||||
-resolvePackageDependencies \
|
||||
-clonedSourcePackagesDirPath .spm-cache
|
||||
|
||||
- name: Run unit tests
|
||||
run: |
|
||||
xcodebuild test \
|
||||
-project LibNovel.xcodeproj \
|
||||
-scheme LibNovel \
|
||||
-configuration Debug \
|
||||
-destination 'platform=iOS Simulator,name=iPhone 17' \
|
||||
-clonedSourcePackagesDirPath .spm-cache \
|
||||
CODE_SIGNING_ALLOWED=NO \
|
||||
| xcpretty --report junit --output test-results.xml || true
|
||||
|
||||
- name: Upload test results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: test-results
|
||||
path: ios/LibNovel/test-results.xml
|
||||
retention-days: 7
|
||||
|
||||
# ── archive (release IPA) ─────────────────────────────────────────────────
|
||||
# Runs only on pushes to v2/main (not PRs).
|
||||
# Requires secrets: APPLE_CERTIFICATE_BASE64, APPLE_CERTIFICATE_PASSWORD,
|
||||
# APPLE_PROVISIONING_PROFILE_BASE64, KEYCHAIN_PASSWORD
|
||||
#
|
||||
# archive:
|
||||
# name: Archive
|
||||
# runs-on: macos-latest
|
||||
# needs: [build, test]
|
||||
# if: gitea.event_name == 'push'
|
||||
#
|
||||
# steps:
|
||||
# - uses: actions/checkout@v4
|
||||
#
|
||||
# - name: Install xcodegen
|
||||
# run: brew install xcodegen
|
||||
#
|
||||
# - name: Generate Xcode project
|
||||
# run: xcodegen generate --spec project.yml --project .
|
||||
# working-directory: ios/LibNovel
|
||||
#
|
||||
# - name: Import signing certificate
|
||||
# env:
|
||||
# CERTIFICATE_BASE64: ${{ secrets.APPLE_CERTIFICATE_BASE64 }}
|
||||
# CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
||||
# KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
|
||||
# run: |
|
||||
# KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
|
||||
# security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
|
||||
# security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
|
||||
# security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
|
||||
# echo "$CERTIFICATE_BASE64" | base64 --decode > $RUNNER_TEMP/cert.p12
|
||||
# security import $RUNNER_TEMP/cert.p12 \
|
||||
# -P "$CERTIFICATE_PASSWORD" \
|
||||
# -A -t cert -f pkcs12 \
|
||||
# -k $KEYCHAIN_PATH
|
||||
# security list-keychain -d user -s $KEYCHAIN_PATH
|
||||
#
|
||||
# - name: Import provisioning profile
|
||||
# env:
|
||||
# PROFILE_BASE64: ${{ secrets.APPLE_PROVISIONING_PROFILE_BASE64 }}
|
||||
# run: |
|
||||
# PP_PATH=$RUNNER_TEMP/profile.mobileprovision
|
||||
# echo "$PROFILE_BASE64" | base64 --decode > $PP_PATH
|
||||
# mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
|
||||
# cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles/
|
||||
#
|
||||
# - name: Archive
|
||||
# run: |
|
||||
# xcodebuild archive \
|
||||
# -project LibNovel.xcodeproj \
|
||||
# -scheme LibNovel \
|
||||
# -configuration Release \
|
||||
# -archivePath $RUNNER_TEMP/LibNovel.xcarchive
|
||||
# working-directory: ios/LibNovel
|
||||
#
|
||||
# - name: Export IPA
|
||||
# run: |
|
||||
# xcodebuild -exportArchive \
|
||||
# -archivePath $RUNNER_TEMP/LibNovel.xcarchive \
|
||||
# -exportPath $RUNNER_TEMP/ipa \
|
||||
# -exportOptionsPlist ios/ExportOptions.plist
|
||||
#
|
||||
# - name: Upload IPA artifact
|
||||
# uses: actions/upload-artifact@v4
|
||||
# with:
|
||||
# name: LibNovel-release
|
||||
# path: ${{ runner.temp }}/ipa/LibNovel.ipa
|
||||
# retention-days: 30
|
||||
Reference in New Issue
Block a user