diff --git a/.github/workflows/archive-develop.yml b/.github/workflows/archive-develop.yml new file mode 100644 index 0000000..5f98e60 --- /dev/null +++ b/.github/workflows/archive-develop.yml @@ -0,0 +1,54 @@ +name: IOSTemplateApp + +on: + push: + branches: develop + +jobs: + build: + name: Archive | develop + runs-on: macos-latest + + steps: + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + + - name: Checkout + uses: actions/checkout@v4 + + - name: Set Default Scheme + run: | + scheme_list=$(xcodebuild -list -json | tr -d "\n") + default=$(echo $scheme_list | ruby -e "require 'json'; puts JSON.parse(STDIN.gets)['project']['targets'][0]") + echo $default | cat >default + echo Using default scheme: $default + + - name: Archive Project + run: | + xcodebuild archive -project IOSTemplateApp.xcodeproj \ + -scheme IOSTemplateApp \ + -sdk iphoneos \ + -configuration Release \ + -archivePath IOSTemplateApp.xcarchive \ + CODE_SIGNING_ALLOWED=NO + + - name: Create ExportOptions.plist + run: | + echo '${{ secrets.EXPORT_OPTIONS }}' > ExportOptions.plist + + - name: Create Private Key + run: | + mkdir private_keys + echo -n '${{ secrets.APPLE_API_KEY_BASE64 }}' | base64 --decode > ./private_keys/AuthKey_${{ secrets.APPLE_API_ISSUER_ID }}.p8 + + - name: Export IPA + run: | + xcodebuild -exportArchive \ + -archivePath IOSTemplateApp.xcarchive \ + -exportOptionsPlist ExportOptions.plist \ + -exportPath app.ipa \ + -allowProvisioningUpdates \ + -authenticationKeyPath `pwd`/private_keys/AuthKey_${{ secrets.APPLE_API_ISSUER_ID }}.p8 \ + -authenticationKeyID ${{ secrets.APPLE_API_KEY_ID }} \ + -authenticationKeyIssuerID ${{ secrets.APPLE_API_ISSUER_ID }} \ No newline at end of file diff --git a/.github/workflows/archive-main.yml b/.github/workflows/archive-main.yml new file mode 100644 index 0000000..00d58aa --- /dev/null +++ b/.github/workflows/archive-main.yml @@ -0,0 +1,54 @@ +name: IOSTemplateApp + +on: + push: + branches: main + +jobs: + build: + name: Archive | main + runs-on: macos-latest + + steps: + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + + - name: Checkout + uses: actions/checkout@v4 + + - name: Set Default Scheme + run: | + scheme_list=$(xcodebuild -list -json | tr -d "\n") + default=$(echo $scheme_list | ruby -e "require 'json'; puts JSON.parse(STDIN.gets)['project']['targets'][0]") + echo $default | cat >default + echo Using default scheme: $default + + - name: Archive Project + run: | + xcodebuild archive -project IOSTemplateApp.xcodeproj \ + -scheme IOSTemplateApp \ + -sdk iphoneos \ + -configuration Release \ + -archivePath IOSTemplateApp.xcarchive \ + CODE_SIGNING_ALLOWED=NO + + - name: Create ExportOptions.plist + run: | + echo '${{ secrets.EXPORT_OPTIONS }}' > ExportOptions.plist + + - name: Create Private Key + run: | + mkdir private_keys + echo -n '${{ secrets.APPLE_API_KEY_BASE64 }}' | base64 --decode > ./private_keys/AuthKey_${{ secrets.APPLE_API_ISSUER_ID }}.p8 + + - name: Export IPA + run: | + xcodebuild -exportArchive \ + -archivePath IOSTemplateApp.xcarchive \ + -exportOptionsPlist ExportOptions.plist \ + -exportPath app.ipa \ + -allowProvisioningUpdates \ + -authenticationKeyPath `pwd`/private_keys/AuthKey_${{ secrets.APPLE_API_ISSUER_ID }}.p8 \ + -authenticationKeyID ${{ secrets.APPLE_API_KEY_ID }} \ + -authenticationKeyIssuerID ${{ secrets.APPLE_API_ISSUER_ID }} \ No newline at end of file diff --git a/.github/workflows/archive-working.yml b/.github/workflows/archive-working.yml new file mode 100644 index 0000000..db2a697 --- /dev/null +++ b/.github/workflows/archive-working.yml @@ -0,0 +1,57 @@ +name: IOSTemplateApp + +on: + push: + branches: + - '**' + - '!main' + - '!develop' + +jobs: + build: + name: Archive | working + runs-on: macos-latest + + steps: + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + + - name: Checkout + uses: actions/checkout@v4 + + - name: Set Default Scheme + run: | + scheme_list=$(xcodebuild -list -json | tr -d "\n") + default=$(echo $scheme_list | ruby -e "require 'json'; puts JSON.parse(STDIN.gets)['project']['targets'][0]") + echo $default | cat >default + echo Using default scheme: $default + + - name: Archive Project + run: | + xcodebuild archive -project IOSTemplateApp.xcodeproj \ + -scheme IOSTemplateApp \ + -sdk iphoneos \ + -configuration Release \ + -archivePath IOSTemplateApp.xcarchive \ + CODE_SIGNING_ALLOWED=NO + + - name: Create ExportOptions.plist + run: | + echo '${{ secrets.EXPORT_OPTIONS }}' > ExportOptions.plist + + - name: Create Private Key + run: | + mkdir private_keys + echo -n '${{ secrets.APPLE_API_KEY_BASE64 }}' | base64 --decode > ./private_keys/AuthKey_${{ secrets.APPLE_API_ISSUER_ID }}.p8 + + - name: Export IPA + run: | + xcodebuild -exportArchive \ + -archivePath IOSTemplateApp.xcarchive \ + -exportOptionsPlist ExportOptions.plist \ + -exportPath app.ipa \ + -allowProvisioningUpdates \ + -authenticationKeyPath `pwd`/private_keys/AuthKey_${{ secrets.APPLE_API_ISSUER_ID }}.p8 \ + -authenticationKeyID ${{ secrets.APPLE_API_KEY_ID }} \ + -authenticationKeyIssuerID ${{ secrets.APPLE_API_ISSUER_ID }} \ No newline at end of file diff --git a/.github/workflows/build-develop.yml b/.github/workflows/build-develop.yml new file mode 100644 index 0000000..12a8b45 --- /dev/null +++ b/.github/workflows/build-develop.yml @@ -0,0 +1,37 @@ +name: IOSTemplateApp + +on: + push: + branches: develop + +jobs: + build: + name: Build | develop + runs-on: macos-latest + + steps: + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + + - name: Checkout + uses: actions/checkout@v4 + + - name: Set Default Scheme + run: | + scheme_list=$(xcodebuild -list -json | tr -d "\n") + default=$(echo $scheme_list | ruby -e "require 'json'; puts JSON.parse(STDIN.gets)['project']['targets'][0]") + echo $default | cat >default + echo Using default scheme: $default + + - name: Build + env: + scheme: ${{ 'default' }} + platform: ${{ 'iOS Simulator' }} + run: | + # xcrun xctrace returns via stderr, not the expected stdout (see https://developer.apple.com/forums/thread/663959) + device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}' | sed -e "s/ Simulator$//"` + if [ $scheme = default ]; then scheme=$(cat default); fi + if [ "`ls -A | grep -i \\.xcworkspace\$`" ]; then filetype_parameter="workspace" && file_to_build="`ls -A | grep -i \\.xcworkspace\$`"; else filetype_parameter="project" && file_to_build="`ls -A | grep -i \\.xcodeproj\$`"; fi + file_to_build=`echo $file_to_build | awk '{$1=$1;print}'` + xcodebuild build-for-testing -scheme "$scheme" -"$filetype_parameter" "$file_to_build" -destination "platform=$platform,name=$device" diff --git a/.github/workflows/build-main.yml b/.github/workflows/build-main.yml new file mode 100644 index 0000000..d29a173 --- /dev/null +++ b/.github/workflows/build-main.yml @@ -0,0 +1,37 @@ +name: IOSTemplateApp + +on: + push: + branches: main + +jobs: + build: + name: Build | main + runs-on: macos-latest + + steps: + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + + - name: Checkout + uses: actions/checkout@v4 + + - name: Set Default Scheme + run: | + scheme_list=$(xcodebuild -list -json | tr -d "\n") + default=$(echo $scheme_list | ruby -e "require 'json'; puts JSON.parse(STDIN.gets)['project']['targets'][0]") + echo $default | cat >default + echo Using default scheme: $default + + - name: Build + env: + scheme: ${{ 'default' }} + platform: ${{ 'iOS Simulator' }} + run: | + # xcrun xctrace returns via stderr, not the expected stdout (see https://developer.apple.com/forums/thread/663959) + device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}' | sed -e "s/ Simulator$//"` + if [ $scheme = default ]; then scheme=$(cat default); fi + if [ "`ls -A | grep -i \\.xcworkspace\$`" ]; then filetype_parameter="workspace" && file_to_build="`ls -A | grep -i \\.xcworkspace\$`"; else filetype_parameter="project" && file_to_build="`ls -A | grep -i \\.xcodeproj\$`"; fi + file_to_build=`echo $file_to_build | awk '{$1=$1;print}'` + xcodebuild build-for-testing -scheme "$scheme" -"$filetype_parameter" "$file_to_build" -destination "platform=$platform,name=$device" diff --git a/.github/workflows/build-working.yml b/.github/workflows/build-working.yml new file mode 100644 index 0000000..1deb73b --- /dev/null +++ b/.github/workflows/build-working.yml @@ -0,0 +1,41 @@ +name: IOSTemplateApp + +on: + push: + branches: + - '**' + - '!main' + - '!develop' + +jobs: + build: + name: Build | working + runs-on: macos-latest + + steps: + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + + - name: Checkout + uses: actions/checkout@v4 + + - name: Set Default Scheme + run: | + xcodebuild -resolvePackageDependencies -project IOSTemplateApp.xcodeproj -scheme IOSTemplateApp + scheme_list=$(xcodebuild -list -json) + echo "$scheme_list" + default=$(echo $scheme_list | ruby -e "require 'json'; puts JSON.parse(STDIN.gets)['project']['targets'][0]") + echo $default | cat >default + echo Using default scheme: $default + + - name: Build + env: + scheme: ${{ 'default' }} + platform: ${{ 'iOS Simulator' }} + run: | + device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}' | sed -e "s/ Simulator$//"` + if [ $scheme = default ]; then scheme=$(cat default); fi + if [ "`ls -A | grep -i \\.xcworkspace\$`" ]; then filetype_parameter="workspace" && file_to_build="`ls -A | grep -i \\.xcworkspace\$`"; else filetype_parameter="project" && file_to_build="`ls -A | grep -i \\.xcodeproj\$`"; fi + file_to_build=`echo $file_to_build | awk '{$1=$1;print}'` + xcodebuild build-for-testing -scheme "$scheme" -"$filetype_parameter" "$file_to_build" -destination "platform=$platform,name=$device" \ No newline at end of file diff --git a/.github/workflows/release-develop.yml b/.github/workflows/release-develop.yml new file mode 100644 index 0000000..c2034d5 --- /dev/null +++ b/.github/workflows/release-develop.yml @@ -0,0 +1,67 @@ +name: IOSTemplateApp + +on: + push: + branches: develop + +jobs: + build: + name: Release | develop + runs-on: macos-latest + + steps: + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + + - name: Checkout + uses: actions/checkout@v4 + + - name: Set Default Scheme + run: | + scheme_list=$(xcodebuild -list -json | tr -d "\n") + default=$(echo $scheme_list | ruby -e "require 'json'; puts JSON.parse(STDIN.gets)['project']['targets'][0]") + echo $default | cat >default + echo Using default scheme: $default + + - name: Archive Project + run: | + xcodebuild archive -project IOSTemplateApp.xcodeproj \ + -scheme IOSTemplateApp \ + -sdk iphoneos \ + -configuration Release \ + -archivePath IOSTemplateApp.xcarchive \ + CODE_SIGNING_ALLOWED=NO + + - name: Create ExportOptions.plist + run: | + echo '${{ secrets.EXPORT_OPTIONS }}' > ExportOptions.plist + + - name: Create Private Key + run: | + mkdir private_keys + echo -n '${{ secrets.APPLE_API_KEY_BASE64 }}' | base64 --decode > ./private_keys/AuthKey_${{ secrets.APPLE_API_ISSUER_ID }}.p8 + + - name: Export IPA + run: | + xcodebuild -exportArchive \ + -archivePath IOSTemplateApp.xcarchive \ + -exportOptionsPlist ExportOptions.plist \ + -exportPath app.ipa \ + -allowProvisioningUpdates \ + -authenticationKeyPath `pwd`/private_keys/AuthKey_${{ secrets.APPLE_API_ISSUER_ID }}.p8 \ + -authenticationKeyID ${{ secrets.APPLE_API_KEY_ID }} \ + -authenticationKeyIssuerID ${{ secrets.APPLE_API_ISSUER_ID }} + + - name: Upload IPA file to App Store Connect + run: | + xcrun altool --upload-app -f app.ipa/IOSTemplateApp.ipa \ + -u ${{ secrets.APPLE_ID }} \ + -p ${{ secrets.APP_SPECIFIC_PASSWORD }} \ + --type ios + + - name: Upload IPA file to GitHub + uses: actions/upload-artifact@v3 + with: + name: IOSTemplateApp.ipa + path: app.ipa/IOSTemplateApp.ipa \ No newline at end of file diff --git a/.github/workflows/release-main.yml b/.github/workflows/release-main.yml new file mode 100644 index 0000000..9198d77 --- /dev/null +++ b/.github/workflows/release-main.yml @@ -0,0 +1,67 @@ +name: IOSTemplateApp + +on: + push: + branches: main + +jobs: + build: + name: Release | main + runs-on: macos-latest + + steps: + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + + - name: Checkout + uses: actions/checkout@v4 + + - name: Set Default Scheme + run: | + scheme_list=$(xcodebuild -list -json | tr -d "\n") + default=$(echo $scheme_list | ruby -e "require 'json'; puts JSON.parse(STDIN.gets)['project']['targets'][0]") + echo $default | cat >default + echo Using default scheme: $default + + - name: Archive Project + run: | + xcodebuild archive -project IOSTemplateApp.xcodeproj \ + -scheme IOSTemplateApp \ + -sdk iphoneos \ + -configuration Release \ + -archivePath IOSTemplateApp.xcarchive \ + CODE_SIGNING_ALLOWED=NO + + - name: Create ExportOptions.plist + run: | + echo '${{ secrets.EXPORT_OPTIONS }}' > ExportOptions.plist + + - name: Create Private Key + run: | + mkdir private_keys + echo -n '${{ secrets.APPLE_API_KEY_BASE64 }}' | base64 --decode > ./private_keys/AuthKey_${{ secrets.APPLE_API_ISSUER_ID }}.p8 + + - name: Export IPA + run: | + xcodebuild -exportArchive \ + -archivePath IOSTemplateApp.xcarchive \ + -exportOptionsPlist ExportOptions.plist \ + -exportPath app.ipa \ + -allowProvisioningUpdates \ + -authenticationKeyPath `pwd`/private_keys/AuthKey_${{ secrets.APPLE_API_ISSUER_ID }}.p8 \ + -authenticationKeyID ${{ secrets.APPLE_API_KEY_ID }} \ + -authenticationKeyIssuerID ${{ secrets.APPLE_API_ISSUER_ID }} + + - name: Upload IPA file to App Store Connect + run: | + xcrun altool --upload-app -f app.ipa/IOSTemplateApp.ipa \ + -u ${{ secrets.APPLE_ID }} \ + -p ${{ secrets.APP_SPECIFIC_PASSWORD }} \ + --type ios + + - name: Upload IPA file to GitHub + uses: actions/upload-artifact@v3 + with: + name: IOSTemplateApp.ipa + path: app.ipa/IOSTemplateApp.ipa \ No newline at end of file diff --git a/IOSTemplateApp/IOSTemplateApp.xcodeproj/project.pbxproj b/IOSTemplateApp.xcodeproj/project.pbxproj similarity index 100% rename from IOSTemplateApp/IOSTemplateApp.xcodeproj/project.pbxproj rename to IOSTemplateApp.xcodeproj/project.pbxproj diff --git a/IOSTemplateApp/IOSTemplateApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/IOSTemplateApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from IOSTemplateApp/IOSTemplateApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to IOSTemplateApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/IOSTemplateApp/IOSTemplateApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/IOSTemplateApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from IOSTemplateApp/IOSTemplateApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to IOSTemplateApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/IOSTemplateApp/IOSTemplateApp/Assets.xcassets/AccentColor.colorset/Contents.json b/IOSTemplateApp/Assets.xcassets/AccentColor.colorset/Contents.json similarity index 100% rename from IOSTemplateApp/IOSTemplateApp/Assets.xcassets/AccentColor.colorset/Contents.json rename to IOSTemplateApp/Assets.xcassets/AccentColor.colorset/Contents.json diff --git a/IOSTemplateApp/Assets.xcassets/AppIcon.appiconset/AppIcon.png b/IOSTemplateApp/Assets.xcassets/AppIcon.appiconset/AppIcon.png new file mode 100644 index 0000000..b83a7c5 Binary files /dev/null and b/IOSTemplateApp/Assets.xcassets/AppIcon.appiconset/AppIcon.png differ diff --git a/IOSTemplateApp/IOSTemplateApp/Assets.xcassets/AppIcon.appiconset/Contents.json b/IOSTemplateApp/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 83% rename from IOSTemplateApp/IOSTemplateApp/Assets.xcassets/AppIcon.appiconset/Contents.json rename to IOSTemplateApp/Assets.xcassets/AppIcon.appiconset/Contents.json index 13613e3..cefcc87 100644 --- a/IOSTemplateApp/IOSTemplateApp/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/IOSTemplateApp/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,6 +1,7 @@ { "images" : [ { + "filename" : "AppIcon.png", "idiom" : "universal", "platform" : "ios", "size" : "1024x1024" diff --git a/IOSTemplateApp/IOSTemplateApp/Assets.xcassets/Contents.json b/IOSTemplateApp/Assets.xcassets/Contents.json similarity index 100% rename from IOSTemplateApp/IOSTemplateApp/Assets.xcassets/Contents.json rename to IOSTemplateApp/Assets.xcassets/Contents.json diff --git a/IOSTemplateApp/IOSTemplateApp/ContentView.swift b/IOSTemplateApp/ContentView.swift similarity index 100% rename from IOSTemplateApp/IOSTemplateApp/ContentView.swift rename to IOSTemplateApp/ContentView.swift diff --git a/IOSTemplateApp/IOSTemplateApp/IOSTemplateApp.swift b/IOSTemplateApp/IOSTemplateApp.swift similarity index 100% rename from IOSTemplateApp/IOSTemplateApp/IOSTemplateApp.swift rename to IOSTemplateApp/IOSTemplateApp.swift diff --git a/IOSTemplateApp/IOSTemplateApp/Preview Content/Preview Assets.xcassets/Contents.json b/IOSTemplateApp/Preview Content/Preview Assets.xcassets/Contents.json similarity index 100% rename from IOSTemplateApp/IOSTemplateApp/Preview Content/Preview Assets.xcassets/Contents.json rename to IOSTemplateApp/Preview Content/Preview Assets.xcassets/Contents.json diff --git a/IOSTemplateApp/IOSTemplateAppTests/IOSTemplateAppTests.swift b/IOSTemplateAppTests/IOSTemplateAppTests.swift similarity index 100% rename from IOSTemplateApp/IOSTemplateAppTests/IOSTemplateAppTests.swift rename to IOSTemplateAppTests/IOSTemplateAppTests.swift diff --git a/IOSTemplateApp/IOSTemplateAppUITests/IOSTemplateAppUITests.swift b/IOSTemplateAppUITests/IOSTemplateAppUITests.swift similarity index 100% rename from IOSTemplateApp/IOSTemplateAppUITests/IOSTemplateAppUITests.swift rename to IOSTemplateAppUITests/IOSTemplateAppUITests.swift diff --git a/IOSTemplateApp/IOSTemplateAppUITests/IOSTemplateAppUITestsLaunchTests.swift b/IOSTemplateAppUITests/IOSTemplateAppUITestsLaunchTests.swift similarity index 100% rename from IOSTemplateApp/IOSTemplateAppUITests/IOSTemplateAppUITestsLaunchTests.swift rename to IOSTemplateAppUITests/IOSTemplateAppUITestsLaunchTests.swift