Slide 1

Slide 1 text

RenovateʹΑΔ iOSϥΠϒϥϦʔͷ ࣗಈߋ৽ @ikesyo / Sho Ikeda potatotips #77 2022-03-24 Thu #potatotips

Slide 2

Slide 2 text

@ikesyo / Sho Ikeda • ͍͚͠ΐʔʗ஑ా ᠳ • גࣜձࣾ͸ͯͳ γχΞΤϯδχΞʢژ౎ʣ • ϚϯΨΞϓϦνʔϜ • iOS / Android / React Native • Swiftίϛολʔ • swift-corelibs-foundation • Quick/Nimbleͷϝϯςφʔ • https://twitter.com/ikesyo • https://github.com/ikesyo

Slide 3

Slide 3 text

ੵۃ࠾༻தͰ͢ https://open.talentio.com/r/1/c/hatena/pages/28838

Slide 4

Slide 4 text

RenovateʹΑΔ iOSϥΠϒϥϦʔͷ ࣗಈߋ৽

Slide 5

Slide 5 text

Renovate • https://renovatebot.com/ • ෳ਺ͷύοέʔδϚωʔδϟʔʢ਺ेʂʣ΍ϓϥοτϑΥʔ ϜʢGitHub, GitLab, Bitbucket, etcʣʹରԠͨ͠ϥΠϒϥϦʔ ͷࣗಈߋ৽πʔϧʢແྉʣ • ಉछͷπʔϧʹ͸GitHubʹ౷߹͞ΕͨDependabotͳͲ΋͋ Γ·͢

Slide 6

Slide 6 text

Why Renovate • iOSࢹ఺: CocoaPodsʢPodfileʣ΍SwiftPMʢPackage.swiftʣʹରԠ ͍ͯ͠Δ • Gradleʢbuild.gradle, Version CatalogʣʹରԠ͍ͯ͠ΔͷͰ AndroidͰ΋࢖͑Δ • ௚઀తʹରԠ͍ͯ͠ͳ͍πʔϧɾϑΝΠϧͰ΋ਖ਼نදݱͰରԠ͕Մೳ ʢॏཁʣ • regex manager: https://docs.renovatebot.com/modules/manager/ regex/

Slide 7

Slide 7 text

Why Renovate • άϧʔϐϯάػೳ • Gradle΍npmͰ1ͭͷϥΠϒϥϦ͕ෳ਺ͷϞδϡʔϧɾ ύοέʔδʹ෼ׂ͞Ε͍ͯΔ࣌ʹɺ1ͭͣͭPRΛ࡞Βͣʹ ·ͱΊͯߋ৽͢Δ͜ͱ͕Մೳ • iOSͰ΋PodfileͰRxSwift΍RxRelay, RxCocoaͷߋ৽Λ1 ͭͷPRʹ·ͱΊͨΓ

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

Why Renovate • ඇৗʹॊೈͳઃఆ߲໨ • https://docs.renovatebot.com/configuration-options/ • ઃఆͷϓϦηοτΛ࡞ͬͯͦΕΛڞ༗ͨ͠Γ֦ு͢Δ͜ͱ ΋Ͱ͖Δ • ͸ͯͳͰ࢖༻͍ͯ͠ΔRenovateͷઃఆϓϦηοτΛެ։͠ ·ͨ͠ - Hatena Developer Blog

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

SwiftPM • Package.resolvedͷߋ৽ʹඇରԠ • PRʹࣗ෼Ͱ௥͍ίϛοτΛ͢Δ͔ɺ΋͘͠͸ • CIͰʢྫ͑͹GitHub ActionsͰʣߋ৽͢ΔϫʔΫϑϩʔΛ ༻ҙ͢Δ

Slide 12

Slide 12 text

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: - ...

Slide 13

Slide 13 text

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. • ૊ΈࠐΈͰ͸ରԠ͍ͯ͠ͳ͍΋ͷͰ΋ɺਖ਼نදݱͰର৅ͷϥΠ ϒϥϦ໊΍όʔδϣϯΛൈ͖ग़͠ɺࢦఆͨ͠σʔλιʔε͔Β ֘౰ͷϥΠϒϥϦͷߋ৽ΛνΣοΫͰ͖Δ • ਖ਼نදݱͰൈ͖ग़ͤͳ͍߲໨͕͋Δ৔߹͸௚઀ࢦఆ΋Ͱ͖Δ

Slide 14

Slide 14 text

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}

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

regex manager - Carthage Cartfile.private: github "Quick/Quick" "v4.0.0" github "Quick/Nimble" "v9.2.1"

Slide 17

Slide 17 text

regex manager - Carthage renovate.json: { "regexManagers": [ { "fileMatch": ["^Cartfile(\\.(private|resolved))?$"], "matchStrings": ["github\\s\\"(?.*?)\\"\\s[\"~>=\\s]+(?[a-zA-Z0-9.]+)"], "datasourceTemplate": "github-tags" } ] }

Slide 18

Slide 18 text

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

Slide 19

Slide 19 text

regex manager - XcodeGen renovate.json: { "regexManagers": [ { "fileMatch": ["^project.yml$"], "matchStrings": [ "url: https:\\/\\/github\\.com\\/(?.*?)(\\.git)?\\s*version: (?.*)\\s" ], "datasourceTemplate": "github-releases" } ] }

Slide 20

Slide 20 text

ϞόΠϧΞϓϦ։ൃͰ΋ ϥΠϒϥϦʔߋ৽Λ ࣗಈԽ͍͖ͯ͠·͠ΐ͏

Slide 21

Slide 21 text

ࢀߟURL • https://renovatebot.com/ • https://docs.renovatebot.com/configuration-options/ • https://docs.renovatebot.com/modules/manager/regex/ • ͸ͯͳͰ࢖༻͍ͯ͠ΔRenovateͷઃఆϓϦηοτΛެ։͠· ͨ͠ - Hatena Developer Blog • RenovateΛiOSΞϓϦ։ൃʹಋೖͯ͠Έͨ - dely tech blog

Slide 22

Slide 22 text

! Happy Renovation

Slide 23

Slide 23 text

Thank you @ikesyo / Sho Ikeda