Skip to content

Commit

Permalink
[feat] #135 appstore_release, release_update 워크플로우 작성
Browse files Browse the repository at this point in the history
  • Loading branch information
ShapeKim98 committed Oct 5, 2024
1 parent f3fbac8 commit 03d2d29
Show file tree
Hide file tree
Showing 4 changed files with 144 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/appstore_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# 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:
pull_request:
branches: [ "main" ]

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: Install GitHub CLI
run: sudo apt-get install gh

- name: Generate Project
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
DEVELOPMENT_TEAM: ${{ secrets.DEVELOPMENT_TEAM }}
run: |
fastlane appstore_profile
make release
- 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 archive

- name: Appstore 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 appstore_release

- name: Check Appstore Review
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 check_app_store_review
29 changes: 29 additions & 0 deletions .github/workflows/release_update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 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:
pull_request:
branches: [ "main" ]
types: [closed]

jobs:
release-update:
if: ${{ github.event.pull_request.merged == true }}
runs-on: macos-latest

steps:
- uses: actions/checkout@v4

- name: Install GitHub CLI
run: sudo apt-get install gh

- name: Update 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 }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: fastlane update_github_release
48 changes: 48 additions & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,52 @@ platform :ios do
changelog: ""
)
end

lane :appstore_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']
)

release_notes = File.read("release_notes.txt")

upload_to_app_store(
api_key: api_key,
skip_metadata: true,
skip_screenshots: true,
release_notes: {
"ko" => release_notes
},
submit_for_review: true,
automatic_release: true
)
end

lane :update_github_release do
require 'spaceship'

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']
)

Spaceship::ConnectAPI.login(api_key: api_key)

app = Spaceship::ConnectAPI::App.find("com.pokitmons.pokit")

live_version = app.get_live_version
app_state = live_version.app_store_state
app_version = live_version.version_string

if app_state == 'READY_FOR_SALE'
pr_number = ENV['PR_NUMBER']
pr_body = sh("gh pr view #{pr_number} --json body --jq '.body'")
release_notes = pr_body.strip

# GitHub 릴리즈 버전 및 릴리즈 노트 업데이트
sh("gh release create v#{app_version} --notes '#{release_notes}'")
end
end
end
1 change: 1 addition & 0 deletions fastlane/release_notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- 자잘한 버그 및 사용성을 개선했어요.

0 comments on commit 03d2d29

Please sign in to comment.