From 11f1bccc82320c9e341622b026b62b0282344cbc Mon Sep 17 00:00:00 2001 From: Daniel Eden Date: Sat, 30 Apr 2022 05:18:55 +0100 Subject: [PATCH] Try to fix build --- .github/workflows/build.yml | 1 + Demo App/Scripts/prebuild.sh | 20 +++++++++++++++++++ .../xcschemes/Twift_SwiftUI.xcscheme | 9 +++++++++ 3 files changed, 30 insertions(+) create mode 100755 Demo App/Scripts/prebuild.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e0078d1..0471a46 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,4 +42,5 @@ jobs: run: | cd Demo\ App cp .env.example .env + ./Scripts/prebuild.sh xcodebuild -scheme Twift_SwiftUI -allowProvisioningUpdates diff --git a/Demo App/Scripts/prebuild.sh b/Demo App/Scripts/prebuild.sh new file mode 100755 index 0000000..b388e97 --- /dev/null +++ b/Demo App/Scripts/prebuild.sh @@ -0,0 +1,20 @@ +if [ ! -f ".env" ]; +then + echo "error: No .env file was found for environment variables. Check the README for setup instructions for this demo app."; + exit 1; +fi + +set -o allexport; source .env; set +o allexport; + +content="import Foundation +/// This file is automatically populated by a pre-action build script in the Twift_SwiftUI scheme +/// **Do not** check in the \`.env\` file or this generated \`Secrets.swift\` file to version control. + +let TWITTER_API_KEY=\"$TWITTER_API_KEY\" +let TWITTER_API_SECRET=\"$TWITTER_API_SECRET\" +let TWITTER_CALLBACK_URL=\"$TWITTER_CALLBACK_URL\" +let CLIENT_ID=\"$CLIENT_ID\" +"; + +echo "$content" > Twift_SwiftUI/Secrets.swift; +exit 0; diff --git a/Demo App/Twift_SwiftUI.xcodeproj/xcshareddata/xcschemes/Twift_SwiftUI.xcscheme b/Demo App/Twift_SwiftUI.xcodeproj/xcshareddata/xcschemes/Twift_SwiftUI.xcscheme index 1624c45..0b36094 100644 --- a/Demo App/Twift_SwiftUI.xcodeproj/xcshareddata/xcschemes/Twift_SwiftUI.xcscheme +++ b/Demo App/Twift_SwiftUI.xcodeproj/xcshareddata/xcschemes/Twift_SwiftUI.xcscheme @@ -5,6 +5,15 @@ + + + + + +