From 3a26a725ae1514afa51487d64402ab6db7e4f715 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=84=ED=98=95?= <108233361+ShapeKim98@users.noreply.github.com> Date: Thu, 25 Jul 2024 17:22:01 +0900 Subject: [PATCH] =?UTF-8?q?[feat]=20#26=20=EC=BD=94=EB=93=9C=20=EC=A0=95?= =?UTF-8?q?=EB=A6=AC=20=EB=B0=8F=20=EC=83=81=ED=99=A9=EB=B3=84=20=EC=9B=8C?= =?UTF-8?q?=ED=81=AC=ED=94=8C=EB=A1=9C=EC=9A=B0=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_test.yml | 45 +++++++++++++ .../{feature.yml => testflight_release.yml} | 44 ++++++------ .github/workflows/workflow_test.yml | 67 +++++++++++++++++++ Makefile | 8 ++- fastlane/Fastfile | 41 +++++++++++- 5 files changed, 177 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/build_test.yml rename .github/workflows/{feature.yml => testflight_release.yml} (57%) create mode 100644 .github/workflows/workflow_test.yml diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml new file mode 100644 index 00000000..aa16368e --- /dev/null +++ b/.github/workflows/build_test.yml @@ -0,0 +1,45 @@ +# This workflow will build a Swift project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift + +name: build-test + +on: + pull_request: + branches: [ "develop" ] + +jobs: + build: + runs-on: macos-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Xcode + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: '15.4' + + - uses: shimataro/ssh-key-action@v2 + with: + key: ${{ secrets.SSH_KEY }} + known_hosts: ${{ secrets.KNOWN_HOSTS }} + + - name: initial mise + run: | + curl https://mise.jdx.dev/install.sh | sh + echo "$HOME/.local/share/mise/bin" >> $GITHUB_PATH + echo "$HOME/.local/share/mise/shims" >> $GITHUB_PATH + + - name: initial tuist + run: mise install tuist + + - name: Test Generate + env: + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + MATCH_URL: ${{ secrets.MATCH_URL }} + APP_STORE_CONNECT_TEAM_ID: ${{ secrets.APP_STORE_CONNECT_TEAM_ID }} + DEVELOPMENT_TEAM: ${{ secrets.DEVELOPMENT_TEAM }} + run: fastlane test generate + + - name: Build Test + run: fastlane build test diff --git a/.github/workflows/feature.yml b/.github/workflows/testflight_release.yml similarity index 57% rename from .github/workflows/feature.yml rename to .github/workflows/testflight_release.yml index f7ebd230..7a6df2c0 100644 --- a/.github/workflows/feature.yml +++ b/.github/workflows/testflight_release.yml @@ -1,11 +1,11 @@ # This workflow will build a Swift project # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift -name: feature-test +name: testflight_release on: push: - branches: [ "feature/*" ] + branches: [ "develop" ] jobs: build: @@ -19,10 +19,10 @@ jobs: with: xcode-version: '15.4' - - uses: shimataro/ssh-key-action@v2 - with: - key: ${{ secrets.SSH_KEY }} - known_hosts: ${{ secrets.KNOWN_HOSTS }} + # - uses: shimataro/ssh-key-action@v2 + # with: + # key: ${{ secrets.SSH_KEY }} + # known_hosts: ${{ secrets.KNOWN_HOSTS }} - name: initial mise run: | @@ -33,30 +33,24 @@ jobs: - name: initial tuist run: mise install tuist - # - name: Create key.json - # run: | - # mkdir -p fastlane - # echo '{ - # "key_id": "${{ secrets.APP_STORE_CONNECT_KEY_ID }}", - # "issuer_id": "${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}", - # "key": "${{ secrets.APP_STORE_CONNECT_API }}", - # "duration": 1200, - # "in_house": false - # }' > fastlane/key.json - - # - name: Match Fastlane - # env: - # MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} - # run: fastlane match appstore --readonly - - - name: Release TestFlight + - name: Generate Project env: MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} MATCH_URL: ${{ secrets.MATCH_URL }} - GITHUB_ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} APP_STORE_CONNECT_TEAM_ID: ${{ secrets.APP_STORE_CONNECT_TEAM_ID }} DEVELOPMENT_TEAM: ${{ secrets.DEVELOPMENT_TEAM }} + run: fastlane generate + + - name: Build Archive + env: + APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }} + APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }} + APP_STORE_CONNECT_API: ${{ secrets.APP_STORE_CONNECT_API }} + run: fastlane build archive + + - name: Beta Release + env: APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }} APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }} APP_STORE_CONNECT_API: ${{ secrets.APP_STORE_CONNECT_API }} - run: fastlane beta + run: fastlane beta release diff --git a/.github/workflows/workflow_test.yml b/.github/workflows/workflow_test.yml new file mode 100644 index 00000000..ee9a63ce --- /dev/null +++ b/.github/workflows/workflow_test.yml @@ -0,0 +1,67 @@ +# This workflow will build a Swift project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift + +name: testflight_release + +on: + push: + branches: [ "feature/*" ] + +jobs: + build: + runs-on: macos-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Xcode + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: '15.4' + + # - uses: shimataro/ssh-key-action@v2 + # with: + # key: ${{ secrets.SSH_KEY }} + # known_hosts: ${{ secrets.KNOWN_HOSTS }} + + - name: initial mise + run: | + curl https://mise.jdx.dev/install.sh | sh + echo "$HOME/.local/share/mise/bin" >> $GITHUB_PATH + echo "$HOME/.local/share/mise/shims" >> $GITHUB_PATH + + - name: initial tuist + run: mise install tuist + + - name: Test Generate + env: + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + MATCH_URL: ${{ secrets.MATCH_URL }} + APP_STORE_CONNECT_TEAM_ID: ${{ secrets.APP_STORE_CONNECT_TEAM_ID }} + DEVELOPMENT_TEAM: ${{ secrets.DEVELOPMENT_TEAM }} + run: fastlane test generate + + - name: Build Test + run: fastlane build test + + - name: Release Generate + env: + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + MATCH_URL: ${{ secrets.MATCH_URL }} + APP_STORE_CONNECT_TEAM_ID: ${{ secrets.APP_STORE_CONNECT_TEAM_ID }} + DEVELOPMENT_TEAM: ${{ secrets.DEVELOPMENT_TEAM }} + run: fastlane release generate + + - name: Build Archive + env: + APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }} + APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }} + APP_STORE_CONNECT_API: ${{ secrets.APP_STORE_CONNECT_API }} + run: fastlane build archive + + - name: Beta Release + env: + APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }} + APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }} + APP_STORE_CONNECT_API: ${{ secrets.APP_STORE_CONNECT_API }} + run: fastlane beta release diff --git a/Makefile b/Makefile index b5e5a381..def24dd3 100644 --- a/Makefile +++ b/Makefile @@ -9,10 +9,14 @@ generate: release: tuist clean tuist install - # tuist cache - # TUIST_DEVELOPMENT_TEAM=$(DEVELOPMENT_TEAM) tuist generate App TUIST_DEVELOPMENT_TEAM=$(DEVELOPMENT_TEAM) tuist generate +test: + tuist clean + tuist install + tuist cache + TUIST_DEVELOPMENT_TEAM=$(DEVELOPMENT_TEAM) tuist generate App + # 1) 템플릿을 다운받음 # 2) Private repository로부터 파일 다운로드 # 3) tuist clean -> install -> generate diff --git a/fastlane/Fastfile b/fastlane/Fastfile index eabb95f5..ae705276 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -17,7 +17,7 @@ default_platform(:ios) platform :ios do desc "Push a new beta build to TestFlight" - lane :beta do + lane: release generate do setup_ci match( @@ -29,7 +29,38 @@ platform :ios do Dir.chdir("../") do sh("make release") end + end + + lane: test generate do + setup_ci + + match( + type: "appstore", + app_identifier:["com.pokitmons.pokit"], + readonly: true + ) + + Dir.chdir("../") do + sh("make test") + end + end + + lane: build test do + build_app( + workspace: "Pokit.xcworkspace", + scheme: "App", + export_method: "app-store", + export_options: { + method: "app-store", + signingStyle: "manual", + provisioningProfiles: { + "com.pokitmons.pokit" => "match AppStore com.pokitmons.pokit 1721720816" + } + } + ) + end + lane: build archive do api_key = app_store_connect_api_key( key_id: ENV['APP_STORE_CONNECT_KEY_ID'], issuer_id: ENV['APP_STORE_CONNECT_ISSUER_ID'], @@ -58,6 +89,14 @@ platform :ios do } } ) + end + + lane: beta release do + api_key = app_store_connect_api_key( + key_id: ENV['APP_STORE_CONNECT_KEY_ID'], + issuer_id: ENV['APP_STORE_CONNECT_ISSUER_ID'], + key_content: ENV['APP_STORE_CONNECT_API'] + ) upload_to_testflight( api_key: api_key,