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

RenovateによるiOSライブラリーの自動更新

Sho Ikeda
March 24, 2022

 RenovateによるiOSライブラリーの自動更新

「potatotips #77 iOS/Android開発Tips共有会」での発表資料です #potatotips

https://potatotips.connpass.com/event/236238/

Sho Ikeda

March 24, 2022
Tweet

More Decks by Sho Ikeda

Other Decks in Programming

Transcript

  1. @ikesyo / Sho Ikeda • ͍͚͠ΐʔʗ஑ా ᠳ • גࣜձࣾ͸ͯͳ γχΞΤϯδχΞʢژ౎ʣ

    • ϚϯΨΞϓϦνʔϜ • iOS / Android / React Native • Swiftίϛολʔ • swift-corelibs-foundation • Quick/Nimbleͷϝϯςφʔ • https://twitter.com/ikesyo • https://github.com/ikesyo
  2. Why Renovate • iOSࢹ఺: CocoaPodsʢPodfileʣ΍SwiftPMʢPackage.swiftʣʹରԠ ͍ͯ͠Δ • Gradleʢbuild.gradle, Version CatalogʣʹରԠ͍ͯ͠ΔͷͰ

    AndroidͰ΋࢖͑Δ • ௚઀తʹରԠ͍ͯ͠ͳ͍πʔϧɾϑΝΠϧͰ΋ਖ਼نදݱͰରԠ͕Մೳ ʢॏཁʣ • regex manager: https://docs.renovatebot.com/modules/manager/ regex/
  3. iOS։ൃͰͷRenovate πʔϧ ରԠঢ়گ උߟ CocoaPods ⭕ " Realm͕͋ΔͱNG1 XcodeGenͱซ༻͍ͯ͠ΔͱNG2 SwiftPM

    # $ Package.resolvedͷߋ৽ͱɺXcode͔Β Swift PackageΛ௥Ճ͢Δ৔߹ʹ͸ඇରԠ3 Carthage ❌ & regex managerΛ࢖͏ XcodeGen (Swift Package) ❌ & regex managerΛ࢖͏ 3 https://github.com/renovatebot/renovate/issues/6924, https://github.com/renovatebot/renovate/issues/9735 2 Renovateͷ࣮ߦ࣌ʹ.xcodeproj͕ଘࡏͤͣɺpod install͕ࣦഊ͢ΔͨΊ 1 https://github.com/renovatebot/renovate/issues/6588
  4. update-package-resolved.yml: on: pull_request: paths: - Package.swift jobs: precheck: runs-on: ubuntu-latest

    outputs: files_changed: ${{ steps.file_changes.outputs.files }} steps: - uses: actions/checkout@v3 - id: file_changes uses: trilom/[email protected] update: runs-on: macos-latest needs: precheck if: contains(fromJson(needs.precheck.outputs.files_changed), 'Package.resolved') == false steps: - ...
  5. regex manager The regex manager is designed to allow users

    to manually configure Renovate for how to find dependencies that aren't detected by the built-in package managers. • ૊ΈࠐΈͰ͸ରԠ͍ͯ͠ͳ͍΋ͷͰ΋ɺਖ਼نදݱͰର৅ͷϥΠ ϒϥϦ໊΍όʔδϣϯΛൈ͖ग़͠ɺࢦఆͨ͠σʔλιʔε͔Β ֘౰ͷϥΠϒϥϦͷߋ৽ΛνΣοΫͰ͖Δ • ਖ਼نදݱͰൈ͖ग़ͤͳ͍߲໨͕͋Δ৔߹͸௚઀ࢦఆ΋Ͱ͖Δ
  6. regex manager - Dockerfileͷྫ Dockerfile: FROM node:12 ENV YARN_VERSION=1.19.1 RUN

    curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version ${YARN_VERSION}
  7. regex manager - Dockerfileͷྫ renovate.json: { "regexManagers": [ { "fileMatch":

    ["^Dockerfile$"], "matchStrings": ["ENV YARN_VERSION=(?<currentValue>.*?)\\n"], "depNameTemplate": "yarn", "datasourceTemplate": "npm" } ] }
  8. regex manager - Carthage renovate.json: { "regexManagers": [ { "fileMatch":

    ["^Cartfile(\\.(private|resolved))?$"], "matchStrings": ["github\\s\\"(?<depName>.*?)\\"\\s[\"~>=\\s]+(?<currentValue>[a-zA-Z0-9.]+)"], "datasourceTemplate": "github-tags" } ] }
  9. regex manager - XcodeGen project.yml: packages: Quick: url: https://github.com/Quick/Quick version:

    4.0.0 Nimble: url: https://github.com/Quick/Nimble version: 9.2.1
  10. regex manager - XcodeGen renovate.json: { "regexManagers": [ { "fileMatch":

    ["^project.yml$"], "matchStrings": [ "url: https:\\/\\/github\\.com\\/(?<depName>.*?)(\\.git)?\\s*version: (?<currentValue>.*)\\s" ], "datasourceTemplate": "github-releases" } ] }