-
Notifications
You must be signed in to change notification settings - Fork 30
168 lines (166 loc) · 7.22 KB
/
archive-and-upload.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
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@v3
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_14.3.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@v3
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@v3
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 }}