-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #161 from shilokuma-inc/fix/develop_workflow
【FEAT】Develop用のワークフロー作成
- Loading branch information
Showing
5 changed files
with
172 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: NinjacordApp | ||
|
||
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: ci_post_clone | ||
run: | | ||
brew install swiftlint | ||
defaults write com.apple.dt.Xcode IDESkipPackagePluginFingerprintValidatation -bool YES | ||
defaults write com.apple.dt.Xcode IDESkipMacroFingerprintValidation -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: | | ||
xcodebuild archive -project discord-bot-helper.xcodeproj \ | ||
-scheme discord-bot-helper \ | ||
-sdk iphoneos \ | ||
-configuration Release \ | ||
-archivePath NinjacordApp.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 NinjacordApp.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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ on: | |
branches: | ||
- '**' | ||
- '!main' | ||
- '!develop' | ||
|
||
jobs: | ||
build: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: NinjacordApp | ||
|
||
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: ci_post_clone | ||
run: | | ||
brew install swiftlint | ||
defaults write com.apple.dt.Xcode IDESkipPackagePluginFingerprintValidatation -bool YES | ||
defaults write com.apple.dt.Xcode IDESkipMacroFingerprintValidation -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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ on: | |
branches: | ||
- '**' | ||
- '!main' | ||
- '!develop' | ||
|
||
jobs: | ||
build: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: NinjacordApp | ||
|
||
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: ci_post_clone | ||
run: | | ||
brew install swiftlint | ||
defaults write com.apple.dt.Xcode IDESkipPackagePluginFingerprintValidatation -bool YES | ||
defaults write com.apple.dt.Xcode IDESkipMacroFingerprintValidation -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: | | ||
xcodebuild archive -project discord-bot-helper.xcodeproj \ | ||
-scheme discord-bot-helper \ | ||
-sdk iphoneos \ | ||
-configuration Release \ | ||
-archivePath NinjacordApp.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 NinjacordApp.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 to App Store Connect | ||
run: | | ||
xcrun altool --upload-app -f app.ipa/NinjacordApp.ipa \ | ||
-u ${{ secrets.APPLE_ID }} \ | ||
-p ${{ secrets.APP_SPECIFIC_PASSWORD }} \ | ||
--type ios |