Skip to content

Commit

Permalink
Merge pull request #12 from shilokuma-inc/chore/workflow
Browse files Browse the repository at this point in the history
【FEAT】workflowの追加
  • Loading branch information
mrs1669 committed May 12, 2024
2 parents 5c5fbf7 + a171267 commit dbf1123
Show file tree
Hide file tree
Showing 21 changed files with 415 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/archive-develop.yml
Original file line number Diff line number Diff line change
@@ -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 }}
54 changes: 54 additions & 0 deletions .github/workflows/archive-main.yml
Original file line number Diff line number Diff line change
@@ -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 }}
57 changes: 57 additions & 0 deletions .github/workflows/archive-working.yml
Original file line number Diff line number Diff line change
@@ -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 }}
37 changes: 37 additions & 0 deletions .github/workflows/build-develop.yml
Original file line number Diff line number Diff line change
@@ -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"
37 changes: 37 additions & 0 deletions .github/workflows/build-main.yml
Original file line number Diff line number Diff line change
@@ -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"
41 changes: 41 additions & 0 deletions .github/workflows/build-working.yml
Original file line number Diff line number Diff line change
@@ -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"
67 changes: 67 additions & 0 deletions .github/workflows/release-develop.yml
Original file line number Diff line number Diff line change
@@ -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
Loading

0 comments on commit dbf1123

Please sign in to comment.