Merge pull request #1629 from NYPL-Simplified/IOS-631/publicationBase… #543
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: SimplyE and Open eBooks Build | |
on: | |
push: | |
branches: | |
- develop | |
- release/** | |
- feature/** | |
jobs: | |
version-check: | |
runs-on: macOS-13 | |
env: | |
GITHUB_TOKEN: ${{ secrets.IOS_DEV_CI_PAT }} | |
steps: | |
- name: Dump GitHub event context | |
env: | |
FULL_EVENT: ${{ toJson(github.event) }} | |
run: echo "FULL_EVENT=$FULL_EVENT" | |
- name: Print System Info | |
run: uname -a | |
- name: Check Carthage version | |
run: command -v carthage && carthage version | |
- name: Checkout main repo | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.IOS_DEV_CI_PAT }} | |
- name: Add Private Repo Auth | |
# This ensures SPM can resolve dependencies for private repos. | |
# Other options included using `-usePackageSupportBuiltinSCM` (or | |
# possibly `-scmProvider system`) in xcodebuild | |
run: echo "GITHUB_REPO_OWNER=$GITHUB_REPO_OWNER" && git config --global --add url."https://${GITHUB_TOKEN}@github.com/${GITHUB_REPO_OWNER}".insteadOf "https://github.com/${GITHUB_REPO_OWNER}" | |
env: | |
GITHUB_REPO_OWNER: ${{ github.repository_owner }} | |
- id: detectapp | |
name: Detect which app to build | |
run: ./scripts/detect-app-to-build.sh | |
env: | |
BUILD_CONTEXT: ci | |
COMMIT_BEFORE_MERGE: ${{ github.event.before }} | |
outputs: | |
simplye_changed: ${{ steps.detectapp.outputs.simplye_changed }} | |
openebooks_changed: ${{ steps.detectapp.outputs.openebooks_changed }} | |
upload-arc: | |
runs-on: macOS-13 | |
needs: version-check | |
if: needs.version-check.outputs.simplye_changed == '1' || needs.version-check.outputs.openebooks_changed == '1' | |
env: | |
GITHUB_TOKEN: ${{ secrets.IOS_DEV_CI_PAT }} | |
steps: | |
- name: Check available Xcodes | |
run: ls -la /Applications | grep Xcode | |
- name: Force Xcode we use for development | |
run: sudo xcode-select -switch /Applications/Xcode_15.0.1.app | |
- name: Install Firebase Tools | |
run: npm install -g firebase-tools | |
- name: Check Firebase Tools version | |
run: command -v firebase && firebase --version | |
- name: Checkout main repo and submodules | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
token: ${{ secrets.IOS_DEV_CI_PAT }} | |
- name: Update Fastlane | |
run: bundle update --bundler && bundle update fastlane | |
- name: Print Fastlane version | |
run: fastlane -v | |
- name: Add Private Repo Auth | |
# This ensures SPM can resolve dependencies for private repos. | |
# Other options included using `-usePackageSupportBuiltinSCM` (or | |
# possibly `-scmProvider system`) in xcodebuild | |
run: echo "GITHUB_REPO_OWNER=$GITHUB_REPO_OWNER" && git config --global --add url."https://${GITHUB_TOKEN}@github.com/${GITHUB_REPO_OWNER}".insteadOf "https://github.com/${GITHUB_REPO_OWNER}" | |
env: | |
GITHUB_REPO_OWNER: ${{ github.repository_owner }} | |
- name: Checkout Adobe RMSDK | |
if: needs.version-check.outputs.simplye_changed == '1' | |
uses: actions/checkout@v4 | |
with: | |
repository: NYPL-Simplified/DRM-iOS-AdeptConnector | |
token: ${{ secrets.IOS_DEV_CI_PAT }} | |
path: ./DRM-iOS-AdeptConnector | |
- name: Setup SimplyE and Open eBooks Distribution Details | |
run: ./scripts/decode-install-secrets.sh | |
env: | |
BUILD_CONTEXT: ci | |
IOS_DISTR_IDENTITY_PASSPHRASE: ${{ secrets.IOS_DISTR_IDENTITY_PASSPHRASE }} | |
IOS_DISTR_IDENTITY_BASE64: ${{ secrets.IOS_DISTR_IDENTITY }} | |
FASTLANE_USER: ${{ secrets.APPLEID_USERNAME }} | |
FASTLANE_PASSWORD: ${{ secrets.APPLEID_PASSWORD }} | |
FASTLANE_SESSION: ${{ secrets.FASTLANE_SESSION }} | |
SPACESHIP_ONLY_ALLOW_INTERACTIVE_2FA: 'true' | |
- name: Set up repo for Adobe DRM build | |
if: needs.version-check.outputs.simplye_changed == '1' | |
run: exec ./scripts/setup-repo-drm.sh | |
env: | |
BUILD_CONTEXT: ci | |
- name: Prepare for Carthage build | |
run: ./scripts/build-dependencies.sh | |
env: | |
BUILD_CONTEXT: ci | |
- name: Carthage Bootstrap | |
uses: NYPL-Simplified/carthage-bootstrap@main | |
with: | |
github-token: ${{ secrets.IOS_DEV_CI_PAT }} | |
platform: iOS | |
use-xcframeworks: true | |
- name: Fetch AudioEngine | |
run: cd ./NYPLAEToolkit && ./scripts/fetch-audioengine.sh | |
- name: Archive SimplyE | |
if: needs.version-check.outputs.simplye_changed == '1' | |
run: ./scripts/xcode-archive.sh simplye | |
env: | |
BUILD_CONTEXT: ci | |
- name: Export SimplyE for Ad Hoc | |
if: needs.version-check.outputs.simplye_changed == '1' | |
run: ./scripts/xcode-export-adhoc.sh simplye | |
env: | |
BUILD_CONTEXT: ci | |
- name: Upload SimplyE to Firebase | |
if: needs.version-check.outputs.simplye_changed == '1' | |
run: ./scripts/firebase-upload.sh simplye | |
env: | |
BUILD_CONTEXT: ci | |
- name: Export SimplyE for App Store | |
if: needs.version-check.outputs.simplye_changed == '1' && startsWith(github.ref, 'refs/heads/release/') | |
run: ./scripts/xcode-export-appstore.sh simplye | |
env: | |
BUILD_CONTEXT: ci | |
- name: Upload SimplyE to TestFlight | |
if: needs.version-check.outputs.simplye_changed == '1' && startsWith(github.ref, 'refs/heads/release/') | |
run: ./scripts/testflight-upload.sh simplye | |
env: | |
BUILD_CONTEXT: ci | |
IOS_DISTR_IDENTITY_PASSPHRASE: ${{ secrets.IOS_DISTR_IDENTITY_PASSPHRASE }} | |
FASTLANE_USER: ${{ secrets.APPLEID_USERNAME }} | |
FASTLANE_PASSWORD: ${{ secrets.APPLEID_PASSWORD }} | |
FASTLANE_SESSION: ${{ secrets.FASTLANE_SESSION }} | |
FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: ${{ secrets.APPLEID_APP_SPECIFIC_PASSWORD }} | |
- name: Archive Open eBooks | |
if: needs.version-check.outputs.openebooks_changed == '1' | |
run: ./scripts/xcode-archive.sh openebooks | |
env: | |
BUILD_CONTEXT: ci | |
- name: Export Open eBooks for Ad Hoc | |
if: needs.version-check.outputs.openebooks_changed == '1' | |
run: ./scripts/xcode-export-adhoc.sh openebooks | |
env: | |
BUILD_CONTEXT: ci | |
- name: Upload Open eBooks to Firebase | |
if: needs.version-check.outputs.openebooks_changed == '1' | |
run: ./scripts/firebase-upload.sh openebooks | |
env: | |
BUILD_CONTEXT: ci | |
- name: Export Open eBooks for App Store | |
if: needs.version-check.outputs.openebooks_changed == '1' && startsWith(github.ref, 'refs/heads/release/') | |
run: ./scripts/xcode-export-appstore.sh openebooks | |
env: | |
BUILD_CONTEXT: ci | |
- name: Upload Open eBooks to TestFlight | |
if: needs.version-check.outputs.openebooks_changed == '1' && startsWith(github.ref, 'refs/heads/release/') | |
run: ./scripts/testflight-upload.sh openebooks | |
env: | |
BUILD_CONTEXT: ci | |
IOS_DISTR_IDENTITY_PASSPHRASE: ${{ secrets.IOS_DISTR_IDENTITY_PASSPHRASE }} | |
FASTLANE_USER: ${{ secrets.APPLEID_USERNAME }} | |
FASTLANE_PASSWORD: ${{ secrets.APPLEID_PASSWORD }} | |
FASTLANE_SESSION: ${{ secrets.FASTLANE_SESSION }} | |
FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: ${{ secrets.APPLEID_APP_SPECIFIC_PASSWORD }} |