diff --git a/.github/workflows/archive-main.yml b/.github/workflows/archive-main.yml new file mode 100644 index 0000000..fea96cd --- /dev/null +++ b/.github/workflows/archive-main.yml @@ -0,0 +1,50 @@ +name: PrimePickApp + +on: + push: + branches: main + +jobs: + build: + name: Archive | main + runs-on: macos-latest + + steps: + - 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 PrimePickApp.xcodeproj \ + -scheme PrimePickApp \ + -sdk iphoneos \ + -configuration Release \ + -archivePath PrimePickApp.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 PrimePickApp.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/2-archive-working.yml b/.github/workflows/archive-working.yml similarity index 100% rename from .github/workflows/2-archive-working.yml rename to .github/workflows/archive-working.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build-main.yml similarity index 88% rename from .github/workflows/build.yml rename to .github/workflows/build-main.yml index 3111609..46b9d16 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build-main.yml @@ -1,14 +1,12 @@ -name: iOS starter workflow +name: PrimePickApp on: push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] + branches: main jobs: build: - name: Build and Test default scheme using any available iPhone simulator + name: Build | main runs-on: macos-latest steps: diff --git a/.github/workflows/1-run-working.yml b/.github/workflows/build-working.yml similarity index 100% rename from .github/workflows/1-run-working.yml rename to .github/workflows/build-working.yml diff --git a/.github/workflows/3-release-main.yml b/.github/workflows/release-main.yml similarity index 100% rename from .github/workflows/3-release-main.yml rename to .github/workflows/release-main.yml