diff --git a/.github/scripts/build_ipa.sh b/.github/scripts/build_ipa.sh new file mode 100644 index 0000000..be34f13 --- /dev/null +++ b/.github/scripts/build_ipa.sh @@ -0,0 +1,16 @@ +#!/bin/sh -x + +xcodebuild -list + +xcodebuild -workspace ./ios/Runner.xcworkspace \ + -scheme CLI \ + -sdk iphoneos \ + -configuration AppStoreDistribution archive \ + -archivePath ./build/CLI.xcarchive + +xcodebuild -exportArchive \ + -archivePath ./build/CLI.xcarchive \ + -exportOptionsPlist ./ios/exportOptions.plist \ + -exportPath ./build + +ls ./build \ No newline at end of file diff --git a/.github/secrets/Apple-Store-UMGC-ios_distribution.p12.gpg b/.github/secrets/Apple-Store-UMGC-ios_distribution.p12.gpg new file mode 100644 index 0000000..0e7c5ac Binary files /dev/null and b/.github/secrets/Apple-Store-UMGC-ios_distribution.p12.gpg differ diff --git a/.github/secrets/Apple-Store-UMGC_Profile.mobileprovision.gpg b/.github/secrets/Apple-Store-UMGC_Profile.mobileprovision.gpg new file mode 100644 index 0000000..08a1ee8 Binary files /dev/null and b/.github/secrets/Apple-Store-UMGC_Profile.mobileprovision.gpg differ diff --git a/.github/secrets/TestBase64.b64 b/.github/secrets/TestBase64.b64 new file mode 100644 index 0000000..29362b9 --- /dev/null +++ b/.github/secrets/TestBase64.b64 @@ -0,0 +1 @@ +VGVzdA== diff --git a/.github/secrets/TestGPG.gpg b/.github/secrets/TestGPG.gpg new file mode 100644 index 0000000..144f342 --- /dev/null +++ b/.github/secrets/TestGPG.gpg @@ -0,0 +1,2 @@ + zBfJ,+'%}=%aHE) Q5<.'/fɍtqAt + \ No newline at end of file diff --git a/.github/secrets/decrypt_secrets.sh b/.github/secrets/decrypt_secrets.sh new file mode 100644 index 0000000..db567e1 --- /dev/null +++ b/.github/secrets/decrypt_secrets.sh @@ -0,0 +1,25 @@ +#!/bin/sh -x + +#echo "$IOS_KEYS" | gpg --batch --yes --passphrase-fd 0 --output ./.github/secrets/TestGPG_output.txt ./.github/secrets/TestGPG.gpg +#cat ./.github/secrets/TestGPG_output.txt + +#base64 -d ./.github/secrets/TestBase64.b64 > ./.github/secrets/TestBase64.txt +#cat ./.github/secrets/TestBase64.txt + +#echo RELOADAGENT | gpg-connect-agent +echo "$IOS_KEYS" | gpg --batch --yes --passphrase-fd 0 --output ./.github/secrets/Apple-Store-UMGC_Profile.mobileprovision --decrypt ./.github/secrets/Apple-Store-UMGC_Profile.mobileprovision.gpg +echo "$IOS_KEYS" | gpg --batch --yes --passphrase-fd 0 --output ./.github/secrets/Apple-Store-UMGC-ios_distribution.p12 --decrypt ./.github/secrets/Apple-Store-UMGC-ios_distribution.p12.gpg + +mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles + +cp ./.github/secrets/Apple-Store-UMGC_Profile.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles/Apple-Store-UMGC_Profile.mobileprovision + +security create-keychain -p "" build.keychain + +security import ./.github/secrets/Apple-Store-UMGC-ios_distribution.p12 -t agg -k ~/Library/Keychains/build.keychain -P "$IOS_KEYS" -A + +security list-keychains -s ~/Library/Keychains/build.keychain +security default-keychain -s ~/Library/Keychains/build.keychain +security unlock-keychain -p "" ~/Library/Keychains/build.keychain + +security set-key-partition-list -S apple-tool:,apple: -s -k "" ~/Library/Keychains/build.keychain \ No newline at end of file diff --git a/.github/workflows/development-pipeline.yml b/.github/workflows/development-pipeline.yml new file mode 100644 index 0000000..f95c84c --- /dev/null +++ b/.github/workflows/development-pipeline.yml @@ -0,0 +1,69 @@ +name: Dev Linter, Build, Unit Test + +env: + FLUTTER_VERSION: "debug" + +on: + push: + branches: [ developer ] + pull_request: + branches: [ developer ] + + workflow_dispatch: + +jobs: +# linter: +# runs-on: ubuntu-latest +# name: Lint flutter code +# steps: +# - name: Checkout code +# uses: actions/checkout@v2 + +# # Setup Flutter +# - name: Set up Flutter +# uses: subosito/flutter-action@v1 + +# # Add formating standards +# - run: | +# cd ./ +# flutter pub add --dev effective_dart +# flutter pub get +# # Analyze +# - name: Analyze Flutter +# uses: ValentinVignal/action-dart-analyze@v0.11 +# with: +# fail-on: "analyze" + + build-ios: + name: Build Project IOS + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + + - run: chmod +x ./.github/secrets/decrypt_secrets.sh + - name: Setup provisioning profile + run: ./.github/secrets/decrypt_secrets.sh + env: + IOS_KEYS: ${{ secrets.IOS_KEYS }} + + - run: chmod +x ./.github/scripts/build_ipa.sh + - name: Create IPA + run: ./.github/scripts/build_ipa.sh + + +# test: +# name: Run Unit Tests +# runs-on: macos-latest + +# steps: +# - uses: actions/checkout@v2 + +# - name: Set up Flutter +# uses: subosito/flutter-action@v1 +# - run: flutter pub get + +# - name: Run tests +# run: flutter test + diff --git a/.github/workflows/main-pipeline.yml b/.github/workflows/main-pipeline.yml new file mode 100644 index 0000000..a198ff1 --- /dev/null +++ b/.github/workflows/main-pipeline.yml @@ -0,0 +1,85 @@ +name: Main Linter, Build, Unit Test + +env: + FLUTTER_VERSION: "debug" + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + linter: + runs-on: ubuntu-latest + name: Lint flutter code + steps: + - name: Checkout code + uses: actions/checkout@v2 + + # Setup Flutter + - name: Set up Flutter + uses: subosito/flutter-action@v1 + + # Add formating standards + - run: | + cd ./ + flutter pub add --dev effective_dart + flutter pub get + # Analyze + - name: Analyze Flutter + uses: ValentinVignal/action-dart-analyze@v0.11 + with: + fail-on: "analyze" + + build-ios: + name: Build Project IOS + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + + - uses: subosito/flutter-action@v1 + - run: flutter pub get + - run: flutter build ios --no-codesign + - run: gem install fastlane + - run: | + cd ./ios + fastlane init + + build-apk: + name: Build Project APK + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + + - name: Set up Flutter + uses: subosito/flutter-action@v1 + - run: flutter pub get + + - name: Build APK + run: flutter build apk + + - name: 'Upload APK Artifact' + uses: 'actions/upload-artifact@v2' + with: + name: memory_enhancer_app-apk-${{env.FLUTTER_VERSION}} + path: ./build/app/outputs/flutter-apk/*.apk + + test: + name: Run Unit Tests + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Flutter + uses: subosito/flutter-action@v1 + - run: flutter pub get + + - name: Run tests + run: flutter test diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json new file mode 100644 index 0000000..5c1374c --- /dev/null +++ b/.vs/VSWorkspaceState.json @@ -0,0 +1,10 @@ +{ + "ExpandedNodes": [ + "", + "\\.github", + "\\.github\\secrets", + "\\.github\\workflows" + ], + "SelectedNode": "\\.github\\secrets\\Apple-Store-UMGC-ios_distribution.p12.gpg", + "PreviewInSolutionExplorer": false +} \ No newline at end of file diff --git a/.vs/fall2021/v16/.suo b/.vs/fall2021/v16/.suo new file mode 100644 index 0000000..c2ecb63 Binary files /dev/null and b/.vs/fall2021/v16/.suo differ diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite new file mode 100644 index 0000000..a43cc2c Binary files /dev/null and b/.vs/slnx.sqlite differ diff --git a/ios/Podfile b/ios/Podfile index 1e8c3c9..5b2db06 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -37,5 +37,9 @@ end post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) + target.build_configurations.each do |config| + config.build_settings['CODE_SIGNING_REQUIRED'] = "NO" + config.build_settings['CODE_SIGNING_ALLOWED'] = "NO" + end end end diff --git a/ios/exportOptions.plist b/ios/exportOptions.plist new file mode 100644 index 0000000..91fe059 --- /dev/null +++ b/ios/exportOptions.plist @@ -0,0 +1,10 @@ + + + + + method + app-store + SWEN670CapstoneFall2021 + SWEN670--- + + \ No newline at end of file