Skip to content

Commit 11f1bcc

Browse files
committed
Try to fix build
1 parent bf59633 commit 11f1bcc

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,5 @@ jobs:
4242
run: |
4343
cd Demo\ App
4444
cp .env.example .env
45+
./Scripts/prebuild.sh
4546
xcodebuild -scheme Twift_SwiftUI -allowProvisioningUpdates

Demo App/Scripts/prebuild.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
if [ ! -f ".env" ];
2+
then
3+
echo "error: No .env file was found for environment variables. Check the README for setup instructions for this demo app.";
4+
exit 1;
5+
fi
6+
7+
set -o allexport; source .env; set +o allexport;
8+
9+
content="import Foundation
10+
/// This file is automatically populated by a pre-action build script in the Twift_SwiftUI scheme
11+
/// **Do not** check in the \`.env\` file or this generated \`Secrets.swift\` file to version control.
12+
13+
let TWITTER_API_KEY=\"$TWITTER_API_KEY\"
14+
let TWITTER_API_SECRET=\"$TWITTER_API_SECRET\"
15+
let TWITTER_CALLBACK_URL=\"$TWITTER_CALLBACK_URL\"
16+
let CLIENT_ID=\"$CLIENT_ID\"
17+
";
18+
19+
echo "$content" > Twift_SwiftUI/Secrets.swift;
20+
exit 0;

Demo App/Twift_SwiftUI.xcodeproj/xcshareddata/xcschemes/Twift_SwiftUI.xcscheme

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@
55
<BuildAction
66
parallelizeBuildables = "YES"
77
buildImplicitDependencies = "YES">
8+
<PreActions>
9+
<ExecutionAction
10+
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
11+
<ActionContent
12+
title = "Run Script"
13+
scriptText = "cd $SRCROOT;&#10;&#10;./Scripts/prebuild.sh&#10;">
14+
</ActionContent>
15+
</ExecutionAction>
16+
</PreActions>
817
<BuildActionEntries>
918
<BuildActionEntry
1019
buildForTesting = "YES"

0 commit comments

Comments
 (0)