Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【CHORE】iOS用のworkflowを追加 & テンプレートも追加 #11

Merged
merged 1 commit into from
May 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/1-Feature.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 機能追加
description: 機能追加のIssue
title: "【FEAT】"
labels: [enhancement]
projects: []
assignees:
- mrs1669
body:
- type: textarea
id: content
attributes:
label: 概要
description: 追加したい機能の説明をお願いします
placeholder: 〜機能を作成しました
validations:
required: true
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/2-Fix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: バグ修正
description: バグのIssue
title: "【FIX】"
labels: [bug]
projects: []
assignees:
- mrs1669
body:
- type: textarea
id: content
attributes:
label: 概要
description: バグ・修正したい機能の説明をお願いします
placeholder: バグ内容
validations:
required: true
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/3-Refactor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: リファクタリング
description: リファクタリングのIssue
title: "【REFACTOR】"
labels: []
projects: []
assignees:
- mrs1669
body:
- type: textarea
id: content
attributes:
label: 概要
description: 内容を説明してください
placeholder: 〜をリファクタリングしました
validations:
required: true
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/4-Chore.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 軽作業
description: 軽作業のIssue
title: "【CHORE】"
labels: []
projects: []
assignees:
- mrs1669
body:
- type: textarea
id: content
attributes:
label: 概要
description: 作業内容を説明してください
placeholder: 〜をしました
validations:
required: true
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/5-BumpUp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: バージョンアップ
description: バージョンアップのIssue
title: "【UPDATE】Bump up version to v"
labels: [update]
projects: []
assignees:
- mrs1669
body:
- type: textarea
id: content
attributes:
label: 概要
description: 前後のバージョンの記載をお願いします
value: v → v
placeholder: "例: v1.1.0 → v1.2.0"
validations:
required: true
23 changes: 23 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!-- What's in this pull request? -->
## 概要 (Abstract)


<!-- If this pull request resolves any GitHub issues -->
## 関連するISSUE
- resolve #

## 詳細 (Detail)
<!-- Thank you for your contribution! -->

<!-- スクリーンショットテンプレート
<table>
<tr>
<th>Before</th>
<th>After</th>
</tr>
<tr>
<td><img width="320" alt="ファイル名" src="URL"></td>
<td><img width="320" alt="ファイル名" src="URL"></td>
</tr>
</table>
-->
61 changes: 61 additions & 0 deletions .github/workflows/archive-develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Archive

on:
push:
branches: develop

jobs:
build:
name: develop
runs-on: macos-latest

steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable

- name: Checkout
uses: actions/checkout@v4

- name: ci_post_clone
run: |
defaults write com.apple.dt.Xcode IDESkipPackagePluginFingerprintValidatation -bool YES

- 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: |
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
scheme_list=$(xcodebuild -list -json | tr -d "\n")
default=$(echo $scheme_list | ruby -e "require 'json'; puts JSON.parse(STDIN.gets)['project']['targets'][0]")
xcodebuild archive -"$filetype_parameter" "$file_to_build" \
-scheme $default \
-sdk iphoneos \
-configuration Release \
-archivePath build.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 build.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 }}
61 changes: 61 additions & 0 deletions .github/workflows/archive-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Archive

on:
push:
branches: main

jobs:
build:
name: main
runs-on: macos-latest

steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable

- name: Checkout
uses: actions/checkout@v4

- name: ci_post_clone
run: |
defaults write com.apple.dt.Xcode IDESkipPackagePluginFingerprintValidatation -bool YES

- 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: |
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
scheme_list=$(xcodebuild -list -json | tr -d "\n")
default=$(echo $scheme_list | ruby -e "require 'json'; puts JSON.parse(STDIN.gets)['project']['targets'][0]")
xcodebuild archive -"$filetype_parameter" "$file_to_build" \
-scheme $default \
-sdk iphoneos \
-configuration Release \
-archivePath build.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 build.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 }}
65 changes: 65 additions & 0 deletions .github/workflows/archive-working.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Archive

on:
push:
branches:
- '**'
- '!main'
- '!develop'

jobs:
build:
name: working
runs-on: macos-latest

steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable

- name: Checkout
uses: actions/checkout@v4

- name: ci_post_clone
run: |
defaults write com.apple.dt.Xcode IDESkipPackagePluginFingerprintValidatation -bool YES

- name: Set Default Scheme
run: |
scheme_list=$(xcodebuild -list -json | tr -d "\n")
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: Archive Project
run: |
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
scheme_list=$(xcodebuild -list -json | tr -d "\n")
default=$(echo $scheme_list | ruby -e "require 'json'; puts JSON.parse(STDIN.gets)['project']['targets'][0]")
xcodebuild archive -"$filetype_parameter" "$file_to_build" \
-scheme $default \
-sdk iphoneos \
-configuration Release \
-archivePath build.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 build.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 }}
41 changes: 41 additions & 0 deletions .github/workflows/build-develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build

on:
push:
branches: develop

jobs:
build:
name: develop
runs-on: macos-latest

steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable

- name: Checkout
uses: actions/checkout@v4

- name: ci_post_clone
run: |
defaults write com.apple.dt.Xcode IDESkipPackagePluginFingerprintValidatation -bool YES

- 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-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build

on:
push:
branches: main

jobs:
build:
name: main
runs-on: macos-latest

steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable

- name: Checkout
uses: actions/checkout@v4

- name: ci_post_clone
run: |
defaults write com.apple.dt.Xcode IDESkipPackagePluginFingerprintValidatation -bool YES

- 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"
Loading
Loading