Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Improving the development environment for react...

Improving the development environment for react-native

React Native Meetup #12 @Online
https://react-native-meetup.connpass.com/event/210587/

いいかんじにバージョンアゲアゲくん
https://gist.github.com/mrtry/8bd873f3f4629692d698c3c1f318b560

release後処理くん
https://gist.github.com/mrtry/52fe8a60e3e4fe81f5455e9d728281e3

よしなにnpm installするくん
https://gist.github.com/mrtry/6a624966e536299e9ca9157ed89cad7d

.xcode-versionと一致してるかをチェックするスクリプト
https://gist.github.com/mrtry/5c30b67d0dbb6342550399c61a34219f

Shinnosuke Yamamoto

May 21, 2021
Tweet

More Decks by Shinnosuke Yamamoto

Other Decks in Technology

Transcript

  1. releaseޙॲཧ͘Μ ϦϦʔεޙʹ΍Δޙॲཧ͕໘౗ 😇 (git fl owӡ༻) • tagଧͪ ← ࣗಈԽͰ΍ͬͯ΄͍͠

    • masterʹmerge ← ࣗಈԽͰ΍ͬͯ΄͍͠ • developͷࠩ෼͋Ε͹औΓࠐΜͰɺdevelop΁merge
  2. releaseޙॲཧ͘Μ jobs: create-tag: steps: - name: Create tag id: create_tag

    run: | tag=$( release branch͔Βx.x.xൈ͍ͯ͘Δ ) - uses: actions/checkout@v2 - run: | git tag ${{ tag }} git push origin ${{ tag } } merge-to-master: steps: - uses: mtanzi/action-automerge@v1 with: github_token: ${{ github.token }} source: ${{ release branch }} target: 'master λάͱmaster൓ө͕ࣗಈͰ͞ΕΔ ͋ͱ͸ɺdevelop෼Λmergeͯ͠ऴΘΓ🥳
  3. Α͠ͳʹnpm install͢Δ͘Μ prevPackageHash=$(Ҡಈલͷpackage.jsonͷhash ) nextPackageHash=$(Ҡಈޙͷpackage.jsonͷhash) if [ "$prevPackageHash" != "$nextPackageHash"

    ]; then npm i els e echo "post-checkout: do nothing " f i npm i͠๨ΕʹΑΔʮͳΜ͔ಈ͔ͳ͍ʯ͕ղফ͞Εͨ🥳
  4. ͍͍͔Μ͡ʹ όʔδϣϯ ΞήΞή͘Μ # package.json·ΘΓΛߋ৽ npm --no-git-tag-version version $versionName #

    iOS fastlane run increment_build_number fastlane run increment_version_number $versionName # Android fastlane run increment_version_code fastlane run increment_version_name $versionName # diffΛ֬ೝ git add -u git diff --cached ͜ΕΛΩϝΕ͹ղܾ🤟 Android͸Plugin࢖ͬͯΔ
  5. ֤छπʔϧͷόʔδϣϯݻఆ(npm/node) { ... "engines": { "node": "14.16.1", "npm": "6.14.12" },

    ... } nvmͰόʔδϣϯἧ͑ͨ .npmrc Ͱ engine-strict=true ͯ͠ɺ࣮ߦ࣌νΣοΫ͔͚ͨ
  6. ֤छπʔϧͷόʔδϣϯݻఆ(Xcode) # Project rootʹҠಈ cd $(git rev-parse --show-toplevel) # όʔδϣϯνΣοΫ

    if [ "$(cat .xcode-version)" != "$(xcodebuild -version | awk 'NR==1{print $2}')" ]; then echo 'Invalid Xcode version' exit 1 fi xcode-install (gem) Λಋೖͨ͠ ҎԼͷεΫϦϓτͰɺϏϧυ࣌ʹνΣοΫ͔͚ͨ
  7. ֤छπʔϧͷόʔδϣϯݻఆ(fastlane) # `fastlane-version` ͱͯ͠Project rootʹఆٛ
 gem 'fastlane', ‘2.183.2 ' 


    # `android/` `ios/` ҎԼͷGemfileʹҎԼΛ௥Ճ
 # `fastlane-version` ΛಡΈࠐΜͰόʔδϣϯΛἧ͑Δ fastlaneVersion = File.join(File.dirname(__FILE__), '../fastlane-version') eval_gemfile(fastlaneVersion) if File.exist?(fastlaneVersion ) fastlaneͷPluginͷॻ͖ํΛࢀߟʹͨ͠