์ผ์ ์ ์์ฑํ ํ ์คํธ ์ฝ๋๋ฅผ Github Action์ ์ด์ฉํด์ ์๋ํํด ๋ณด์.
[ReactorKit] ํ ์คํธ ์ฝ๋ ์์ฑํด๋ณด๊ธฐ (feat.expectation)
ReactorKit์ ๊ณต๋ถํ๊ธฐ ์ํด์ ์ ์ ์งํํ๋ ํ๋ก์ ํธ๋ค. GitHub - 9oHigh/usket.RandomUser: Random User Generator๋ฅผ ํ์ฉํ ReactorKit & RxDataSource ํ์ตRandom User Generator๋ฅผ ํ์ฉํ ReactorKit & RxDataSource ํ์ต - 9oHigh/usk
pooh-footprints.tistory.com
ํ์ฌ ํ๋ก์ ํธ์๋
develop์ด๋ release ๋ธ๋์น๊ฐ ์์ด main ๋ธ๋์น ํ๋๋ง ์๋ค.
๋ฐ๋ผ์ main ๋ธ๋์น์ Push ํน์ PR ์์ฒญ ์ ํ ์คํธ๋ฅผ ์งํํ๋ค.
1. ๋ ํฌ์งํ ๋ฆฌ์ Action์ ๋ค์ด๊ฐ [ Set up this workflow ]๋ฅผ ํด๋ฆญ
2. yml ํ์ผ์ ์์ฑํด ๋ณด์.
name: Build & Test
on:
# main ๋ธ๋์น์ push ๋ pull request ์ด๋ฒคํธ๊ฐ ๋ฐ์ํ๋ฉด ํ์ workflow ์คํ
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs: # workflow๋ ํ๋ ์ด์์ jobs๋ก ๋ง๋ค์ด์ง
build:
runs-on: macos-latest
steps:
# uses ํค์๋๋ฅผ ํตํด Github Actions์์ ๊ธฐ๋ณธ์ผ๋ก ์ ๊ณตํ๋ ์ก์
์ ์ฌ์ฉ ๊ฐ๋ฅ.
# repository์ ์ฒดํฌ์์
- uses: actions/checkout@v2
# Package.resolved์์ ์ค๋ฅ๊ฐ ๋ฐ์ / ์ ๊ฑฐํ๊ณ , resolve
- name: Delete Package.resolved
run: rm -f usket.RandomUser/usket.RandomUser/usket.RandomUser/usket.RandomUser.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
- name: Clean package cache
run: rm -rf ~/Library/Caches/org.swift.swiftpm
- name: Resolve package dependencies
run: xcodebuild -resolvePackageDependencies -project usket.RandomUser/usket.RandomUser.xcodeproj
- name: Start xcode build ๐
run: |
xcodebuild clean test -project usket.RandomUser/usket.RandomUser.xcodeproj -scheme usket.RandomUser -destination 'platform=iOS Simulator,name=iPhone 14,OS=17.2'
main ๋ธ๋์น์ push ํ๊ฑฐ๋ pr ์์ฒญ์ด ๋ค์ด์์ ๋ workflow๋ฅผ ์งํํ๊ธฐ ์ํด on ํค์๋์ ์์ ๊ฐ์ด ์์ฑํด์ผ ํ๋ค.
on์ workflow๋ฅผ ์คํํ๊ธฐ ์ํ ํธ๋ฆฌ๊ฑฐ๋ฅผ ์ค์ ํ๋ ํค์๋๋ค.
์ดํ jobs๋ฅผ ์ค์ ํด์ผ ํ๋ค.
jobs๋ workflow์ ๊ตฌ์ฑ์์๋ค.
์ง๊ธ์ ๋น๋ ๋ฐ ํ ์คํธ๋ง ์งํํ์ง๋ง ๋ ๋ค๋ฅธ CI๋ฅผ ์งํํด์ผ ํ๋ค๋ฉด ์ฌ์ฉํ ์ ์๋ค.
โPackage.resolved๋ฅผ ์ ๊ฑฐํ๊ณ resolve ํ๋ ์ฝ๋๊ฐ ์๋ ๊ฑธ ๋ณผ ์ ์๋ค.
PinsStore์ ๋ฒ์ ์ด 3์ด๋ผ์ ์งํํ ์ ์๋ค๋ ๋ฑ์ ์ค๋ฅ๊ฐ ๋ฐ์ํ์๋๋ฐ
swiftpm ํด๋์ ๋ค์ด๊ฐ Package.resolved์ ๊ฐ์ฅ ํ๋จ์ version์ 3์์ 2๋ก ๋ฐ๊พธ์๋๋ ์ ์์ ์ผ๋ก ๋์ํ๋ค.
ํน์ ๊ด๋ จํ์ฌ ์ค๋ฅ๊ฐ ๋ฐ์ํ๋ค๋ฉด ์๋ํด ๋ณด์.
3. ์์ ๊ฐ์ด ์์ฑํ๊ณ Commit ํ๋ค๋ฉด ์๋์ ๊ฐ์ด ํด๋๊ฐ ์๊ธฐ๊ณ , yml ํ์ผ์ด ๋ค์ด์์ ๊ฒ์ด๋ค.
4. ์ดํ push๋ pr์ ์์ฒญํ ๋ค์ Actions์ ๋ค์ ๋ค์ด๊ฐ ๋ณด๋ฉด ์๋์ฒ๋ผ ์ ์์ ์ผ๋ก ๋์ํ๋ ๊ฒ์ ํ์ธํ ์ ์๋ค.
์ถ๊ฐ์ ์ผ๋ก iPhone ๊ธฐ์ข ๊ณผ version์ด ํ๋ก์ ํธ์ minimum target๊ณผ ๋ง์ง ์์์ ์คํจํ ์๋ ์์ผ๋ ํ์ธํด ๋ณด๊ณ ์งํํ์.
์๋ ๋ฐฐํฌ๊น์ง ํด๋ณด๊ณ ์ถ๋ค๋ฉด ์๋์ ํฌ์คํ ์ ํ์ธํ์.
[Git & Github] Github Action์ผ๋ก TestFlight ์ ๋ก๋ ํด๋ณด๊ธฐ(1)
์๋ ํ์ธ์~ ์ด๋ฒ ํฌ์คํ ์์๋ Github Action์ ๋ํ ์ค๋ช ๊ณผ Github์์ ์ด๋ป๊ฒ ์ฌ์ฉํ ์ ์๋์ง ์์ฑํด๋ณด๋ ค๊ณ ํฉ๋๋ค. Github Action ์ด๋? - Github ์ ์ฅ์๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ์ํํธ์จ์ด ๊ฐ๋ฐ Workflow๋ฅผ ์๋ํ
pooh-footprints.tistory.com
[Git & Github] Github Action์ผ๋ก TestFlight ์ ๋ก๋ ํด๋ณด๊ธฐ(2)
์๋ ํ์ธ์ ~ ์ ๋ฒ ํฌ์คํ ์ ์ด์ด์ TestFlight์ ์ด๋ป๊ฒ ๋ฐฐํฌํ ์ ์๋์ง ์์๋ณด๊ฒ ์ต๋๋ค : ) ์ฌ์ ์ค๋น Github Action - Build - (Unit Test) - Archive - ipa ์์ฑ ๋ฐ TestFlight์ ์ ๋ก๋ ์์ 3~4๊ฐ์ง์ ๋จ๊ณ๋ฅผ ๊ฑฐ
pooh-footprints.tistory.com
[Git & Github] Github Action์ผ๋ก TestFlight ์ ๋ก๋ ํด๋ณด๊ธฐ(3)
์๋ ํ์ธ์~ ์ค๋์ Github Action์ผ๋ก TestFlight์ ๋ฐฐํฌํ๋ ๊ณผ์ ์ ๋ง๋ฌด๋ฆฌ ํฌ์คํ ์ด ๋ ๊ฒ ๊ฐ์ต๋๋ค : ) [ ์ผ๋จ ์ง๋ ํฌ์คํ - ์ฌ์ ์ค๋น ] [Git & Github] Github Action์ผ๋ก TestFlight ์ ๋ก๋ ํด๋ณด๊ธฐ(2) ์๋ ํ
pooh-footprints.tistory.com