From 1e081799f73299de960000b03cfe4f36b6e99a5c Mon Sep 17 00:00:00 2001 From: Takumi Muraishi Date: Fri, 10 May 2024 04:47:48 +0900 Subject: [PATCH 01/13] [chore] make archive workflow --- .github/workflows/archive.yml | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/archive.yml diff --git a/.github/workflows/archive.yml b/.github/workflows/archive.yml new file mode 100644 index 0000000..8e2d887 --- /dev/null +++ b/.github/workflows/archive.yml @@ -0,0 +1,42 @@ +name: Build + +on: + push + +jobs: + build: + name: Build + runs-on: macos-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Archive Project + run: | + xcodebuild archive -project MyApp/MyApp.xcodeproj \ + -scheme MainApp \ + -sdk iphoneos \ + -configuration Release \ + -archivePath MainApp.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 MainApp.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 From 88449de2927af74ac916b143823eb0e329f91258 Mon Sep 17 00:00:00 2001 From: Takumi Muraishi Date: Fri, 10 May 2024 04:49:35 +0900 Subject: [PATCH 02/13] [chore] fix Build (commit) yml --- .github/workflows/build_commit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_commit.yml b/.github/workflows/build_commit.yml index 8842ef6..fd73d4e 100644 --- a/.github/workflows/build_commit.yml +++ b/.github/workflows/build_commit.yml @@ -3,7 +3,7 @@ name: Build (commit) on: push: branches: - - '*' + - '**' - '!main' jobs: From 1b86d7bb6d75d4934cc3cc3dad875f4e69c5b877 Mon Sep 17 00:00:00 2001 From: Takumi Muraishi Date: Fri, 10 May 2024 04:54:20 +0900 Subject: [PATCH 03/13] [chore] fix archive workflow --- .github/workflows/build_commit.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_commit.yml b/.github/workflows/build_commit.yml index fd73d4e..039a8d2 100644 --- a/.github/workflows/build_commit.yml +++ b/.github/workflows/build_commit.yml @@ -14,6 +14,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + - name: Set Default Scheme run: | scheme_list=$(xcodebuild -list -json | tr -d "\n") From e9997a2d2f5f2bb5c80447694e328ccae305eb1a Mon Sep 17 00:00:00 2001 From: Takumi Muraishi Date: Fri, 10 May 2024 04:54:25 +0900 Subject: [PATCH 04/13] [chore] fix archive workflow --- .github/workflows/archive.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/archive.yml b/.github/workflows/archive.yml index 8e2d887..8b0aa1a 100644 --- a/.github/workflows/archive.yml +++ b/.github/workflows/archive.yml @@ -1,4 +1,4 @@ -name: Build +name: Archive on: push @@ -12,6 +12,13 @@ jobs: - 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 MyApp/MyApp.xcodeproj \ From 9ff68f2b276eb2fbfd2c9670f711e2a0fca9e14f Mon Sep 17 00:00:00 2001 From: Takumi Muraishi Date: Fri, 10 May 2024 04:57:35 +0900 Subject: [PATCH 05/13] [chore] fix whitespace --- .github/workflows/build.yml | 2 ++ .github/workflows/build_commit.yml | 1 + 2 files changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4b0795f..3111609 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,12 +14,14 @@ jobs: 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: Build env: scheme: ${{ 'default' }} diff --git a/.github/workflows/build_commit.yml b/.github/workflows/build_commit.yml index 039a8d2..07106db 100644 --- a/.github/workflows/build_commit.yml +++ b/.github/workflows/build_commit.yml @@ -21,6 +21,7 @@ jobs: 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' }} From cbf0331b5d44ab9fba4d9e88d5b2c076ffe9d5ac Mon Sep 17 00:00:00 2001 From: Takumi Muraishi Date: Fri, 10 May 2024 05:01:34 +0900 Subject: [PATCH 06/13] [chore] fix workflow name --- .github/workflows/build_commit.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_commit.yml b/.github/workflows/build_commit.yml index 07106db..4541b0b 100644 --- a/.github/workflows/build_commit.yml +++ b/.github/workflows/build_commit.yml @@ -1,4 +1,4 @@ -name: Build (commit) +name: PrimePickApp on: push: @@ -8,7 +8,7 @@ on: jobs: build: - name: Build and Test default scheme using any available iPhone simulator + name: Build(working branch) runs-on: macos-latest steps: From f2641ff76934e0f85ee1bd147bcf8407a6975d71 Mon Sep 17 00:00:00 2001 From: Takumi Muraishi Date: Fri, 10 May 2024 05:07:37 +0900 Subject: [PATCH 07/13] [chore] fix workflow name --- .github/workflows/archive.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/archive.yml b/.github/workflows/archive.yml index 8b0aa1a..bd4b9a9 100644 --- a/.github/workflows/archive.yml +++ b/.github/workflows/archive.yml @@ -1,11 +1,14 @@ -name: Archive +name: PrimePickApp on: push + branches: + - '**' + - '!main' jobs: build: - name: Build + name: Archive | working branch runs-on: macos-latest steps: From f4e41bd6c12b6646572530ed369e1e55f98e8153 Mon Sep 17 00:00:00 2001 From: Takumi Muraishi Date: Fri, 10 May 2024 05:09:12 +0900 Subject: [PATCH 08/13] [chore] fix archive workflow error --- .github/workflows/archive.yml | 2 +- .github/workflows/build_commit.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/archive.yml b/.github/workflows/archive.yml index bd4b9a9..319a6a8 100644 --- a/.github/workflows/archive.yml +++ b/.github/workflows/archive.yml @@ -1,7 +1,7 @@ name: PrimePickApp on: - push + push: branches: - '**' - '!main' diff --git a/.github/workflows/build_commit.yml b/.github/workflows/build_commit.yml index 4541b0b..2786f5d 100644 --- a/.github/workflows/build_commit.yml +++ b/.github/workflows/build_commit.yml @@ -8,7 +8,7 @@ on: jobs: build: - name: Build(working branch) + name: Build | working branch runs-on: macos-latest steps: From 47f9dfad5051b666fa95f4b76b203d975158e13e Mon Sep 17 00:00:00 2001 From: Takumi Muraishi Date: Fri, 10 May 2024 05:21:38 +0900 Subject: [PATCH 09/13] [chore] swap build path --- .github/workflows/archive.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/archive.yml b/.github/workflows/archive.yml index 319a6a8..d2e8083 100644 --- a/.github/workflows/archive.yml +++ b/.github/workflows/archive.yml @@ -24,8 +24,8 @@ jobs: - name: Archive Project run: | - xcodebuild archive -project MyApp/MyApp.xcodeproj \ - -scheme MainApp \ + xcodebuild archive -project prime-pick-ios/PrimePickApp.xcodeproj \ + -scheme PrimePickApp \ -sdk iphoneos \ -configuration Release \ -archivePath MainApp.xcarchive \ From e80df04a871f3b458b30afe81993a85d77760869 Mon Sep 17 00:00:00 2001 From: Takumi Muraishi Date: Fri, 10 May 2024 05:24:04 +0900 Subject: [PATCH 10/13] [chore] rename workflow ile --- .github/workflows/{build_commit.yml => 1-run-working_branch.yml} | 0 .github/workflows/{archive.yml => 2-archive-working_branch.yml} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{build_commit.yml => 1-run-working_branch.yml} (100%) rename .github/workflows/{archive.yml => 2-archive-working_branch.yml} (100%) diff --git a/.github/workflows/build_commit.yml b/.github/workflows/1-run-working_branch.yml similarity index 100% rename from .github/workflows/build_commit.yml rename to .github/workflows/1-run-working_branch.yml diff --git a/.github/workflows/archive.yml b/.github/workflows/2-archive-working_branch.yml similarity index 100% rename from .github/workflows/archive.yml rename to .github/workflows/2-archive-working_branch.yml From 6b9bc2e2eaa9bafc330847064b0e3908ec904eb0 Mon Sep 17 00:00:00 2001 From: Takumi Muraishi Date: Fri, 10 May 2024 05:25:43 +0900 Subject: [PATCH 11/13] [chore] fix project path --- .github/workflows/2-archive-working_branch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/2-archive-working_branch.yml b/.github/workflows/2-archive-working_branch.yml index d2e8083..73379c0 100644 --- a/.github/workflows/2-archive-working_branch.yml +++ b/.github/workflows/2-archive-working_branch.yml @@ -24,7 +24,7 @@ jobs: - name: Archive Project run: | - xcodebuild archive -project prime-pick-ios/PrimePickApp.xcodeproj \ + xcodebuild archive -project PrimePickApp.xcodeproj \ -scheme PrimePickApp \ -sdk iphoneos \ -configuration Release \ From 5f0b088a73443785baf9959ada431e3e46ea0585 Mon Sep 17 00:00:00 2001 From: Takumi Muraishi Date: Fri, 10 May 2024 05:26:52 +0900 Subject: [PATCH 12/13] [chore] fix archivePath --- .github/workflows/2-archive-working_branch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/2-archive-working_branch.yml b/.github/workflows/2-archive-working_branch.yml index 73379c0..e393322 100644 --- a/.github/workflows/2-archive-working_branch.yml +++ b/.github/workflows/2-archive-working_branch.yml @@ -28,7 +28,7 @@ jobs: -scheme PrimePickApp \ -sdk iphoneos \ -configuration Release \ - -archivePath MainApp.xcarchive \ + -archivePath PrimePickApp.xcarchive \ CODE_SIGNING_ALLOWED=NO - name: Create ExportOptions.plist From 6e5d6567bf4eeb6879266f5dedec7c76ae6beb42 Mon Sep 17 00:00:00 2001 From: Takumi Muraishi Date: Fri, 10 May 2024 05:29:27 +0900 Subject: [PATCH 13/13] [chore] fix archivePath --- .github/workflows/2-archive-working_branch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/2-archive-working_branch.yml b/.github/workflows/2-archive-working_branch.yml index e393322..d440f79 100644 --- a/.github/workflows/2-archive-working_branch.yml +++ b/.github/workflows/2-archive-working_branch.yml @@ -43,7 +43,7 @@ jobs: - name: Export IPA run: | xcodebuild -exportArchive \ - -archivePath MainApp.xcarchive \ + -archivePath PrimePickApp.xcarchive \ -exportOptionsPlist ExportOptions.plist \ -exportPath app.ipa \ -allowProvisioningUpdates \