Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
githubactions-potetotips.pdf
Search
katsutomu
February 12, 2020
Programming
2
610
githubactions-potetotips.pdf
katsutomu
February 12, 2020
Tweet
Share
More Decks by katsutomu
See All by katsutomu
チームで進めるRenovate
katsutomu
0
65
CDC Testing試してみた
katsutomu
0
2.8k
Other Decks in Programming
See All in Programming
Remix on Hono on Cloudflare Workers
yusukebe
1
300
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
350
3rd party scriptでもReactを使いたい! Preact + Reactのハイブリッド開発
righttouch
PRO
1
610
色々なIaCツールを実際に触って比較してみる
iriikeita
0
340
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
1k
受け取る人から提供する人になるということ
little_rubyist
0
250
ヤプリ新卒SREの オンボーディング
masaki12
0
130
C++でシェーダを書く
fadis
6
4.1k
CSC509 Lecture 12
javiergs
PRO
0
160
Jakarta EE meets AI
ivargrimstad
0
660
よくできたテンプレート言語として TypeScript + JSX を利用する試み / Using TypeScript + JSX outside of Web Frontend #TSKaigiKansai
izumin5210
6
1.8k
Macとオーディオ再生 2024/11/02
yusukeito
0
380
Featured
See All Featured
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
Visualization
eitanlees
145
15k
Unsuck your backbone
ammeep
668
57k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Testing 201, or: Great Expectations
jmmastey
38
7.1k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
4 Signs Your Business is Dying
shpigford
180
21k
Typedesign – Prime Four
hannesfritz
40
2.4k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
Embracing the Ebb and Flow
colly
84
4.5k
Transcript
ࠓ͔Β࢝ΊΔ GithubActions
ࣗݾհ ❖ ؔࠜ ࠀయ @katsutomu ❖ ίωώτגࣜձࣾ / Android Engineer
❖ 2017/11/01ʹjoin ❖ ࠷ۙTLͱͯ͠Ϛωδϝϯτͬͯ·͢
͖ΐ͏͢͜ͱ ❖ Github Actions֓ཁ ❖ ϫʔΫϑϩʔͷղઆ ❖ ΞΫγϣϯͷղઆ ❖ ϚϚϦΞϓϦͰ͍ͬͯΔ͜ͱ
Github Actions֓ཁ
֓ཁ ❖ GithubͷΠϕϯτΛτϦΨʔʹ͠ ͯɺಛఆͷϫʔΫϑϩʔΛ࣮ߦͰ ͖Δ ❖ ϫʔΫϑϩʔDockerίϯςφ্ ͰՔಇ͠ɺΞΫγϣϯΛ࣮ߦ͢Δ ❖ ΞΫγϣϯΞΫγϣϯҎԼͷ
ͷΛར༻Ͱ͖Δ ❖ ϦϙδτϦͰఆٛ͞Ε͍ͯΔΞΫγϣϯ ❖ GitHubͷOSSͷΞΫγϣϯ ❖ ެ։͞Ε͍ͯΔDockerίϯςφΠϝʔδ
ϫʔΫϑϩʔͷղઆ
ϫʔΫϑϩʔͱ ❖ Ϗϧυɺςετɺύοέʔδɺ ϦϦʔεɺͳͲΛࣗಈԽ͢Δ ϓϩηε ❖ 1ͭҎ্ͷδϣϒ͔Βߏ͞ ΕɺΞΫγϣϯΛݺͼग़ͯ͠ ಛఆͷखଓ͖Λ࣮ߦ͢Δ ϫʔΫϑϩʔ
Job1 Job2 Action Action Action Action Πϕϯτ
ϫʔΫϑϩʔͷ࡞Γํ ❖ ϫʔΫϑϩʔΛτϦΨʔ͢ΔΠϕϯτΛࢦఆ ❖ ϫʔΫϑϩʔͰ࣮ߦ͢Δδϣϒ/ΞΫγϣϯΛࢦఆ ❖ ͜ΕΒΛyamlͰهड़
TopϨϕϧߏจ ❖ nameɿϫʔΫϑϩʔͷ໊લ ❖ onɿτϦΨʔ͢ΔΠϕϯτͷࢦఆ ❖ envɿͯ͢ͷjobɺstepͰ༻͢Δڥม ❖ jobsɿҰ࿈ͷ࡞ۀΛهड़͢Δ
onߏจ ❖ onɿτϦΨʔ͢ΔΠϕϯτͷࢦఆ ❖ on.<event_name>.typesɿϑΟϧλʔ͢ΔΠϕϯτͷछ ྨΛࢦఆ ❖ on.<push|pull_request>.<branches|tags>ɿϑΟϧλʔ ͢Δϒϥϯν/λάͷࢦఆ
ࢦఆͰ͖ΔΠϕϯτ ❖ WebhookΠϕϯτɿGithubͰൃੜͨ͠Πϕϯτ ❖ push/create/pull_request/etc… ❖ εέδϡʔϧΠϕϯτɿಛఆͷ࣌ؒʹ࣮ߦ͢ΔΠϕϯτ ❖ ֎෦ΠϕϯτɿGithub APIܦ༝Ͱ࣮ߦ͢ΔΠϕϯτ
jobsߏจ ❖ jobs.<job_id>ɿδϣϒͷID ❖ jobs.<job_id>.nameɿδϣϒͷ໊લɻGithub্Ͱදࣔ͞ ΕΔ ❖ jobs.<job_id>.runs-onɿ࣮ߦ͞ΕΔԾڥΛࢦఆ ❖ jobs.<job_id>.stepsɿҰཡͷλεΫΛ·ͱΊͨͷ
❖ jobs.<job_id>.steps.usesɿ࣮ߦ͢ΔΞΫγϣϯͷࢦఆ
͜Μͳײ͡ʹͳΔ
͜Μͳײ͡ʹͳΔ ϫʔΫϑϩʔ Job1 Job2 Action Action Πϕϯτ Job3 Action
͜Μͳײ͡ Push͕ൃੜͨ࣌͠ʹ
͜Μͳײ͡ ࣮ߦ͢ΔҰ࿈ͷ jobΛࢦఆͯ͠
͜Μͳײ͡ job͝ͱʹ࣮ߦ͢Δ ڥ/εςοϓΛࢦఆ
͜Μͳײ͡ ࣮ߦ͢ΔԾڥΛ ࢦఆ
͜Μͳײ͡ εςοϓ͝ͱʹ ΞΫγϣϯΛࢦఆ
͜Μͳײ͡ ॱ൪ʹδϣϒ͕ ࣮ߦ͞Εͯ ϫʔΫϑϩʔ͕ྃ͢Δ
ΞΫγϣϯͷղઆ
ΞΫγϣϯͱ ❖ ΞΫγϣϯɺϫʔΫϑϩʔͷ࠷খͷߏཁૉ ❖ OSSͰڞ༗͞ΕΔΞΫγϣϯΛར༻͢Δ͜ͱಠࣗʹΞ ΫγϣϯΛ࡞Δ͜ͱ͕Մೳ ❖ ϫʔΫϑϩʔʹεςοϓͱؚͯ͠ΊͯΞΫγϣϯΛར༻ ͢Δ
ΞΫγϣϯͷछྨ ❖ Dockerίϯςφ ❖ ΞΫγϣϯͷར༻ऀ͕πʔϧґଘؔΛߟྀ͠ͳͯ͘ࡁΉ ❖ GitHubʹϗετ͞ΕͨLinuxڥͰΈ࣮ߦͰ͖·͢ɻ ❖ JavaScript ❖
࣮ߦʹ༻͞ΕΔڥ͔ΒΓ͚Δ͜ͱ͕Ͱ͖Δ ❖ GitHubʹϗετ͞ΕͨLinuxɺMacOSɺWindowsͷԾϚ γϯͰՔಇ
ΞΫγϣϯͷछྨ ❖ Dockerίϯςφ ❖ ΞΫγϣϯͷར༻ऀ͕πʔϧґଘؔΛߟྀ͠ͳͯ͘ࡁΉ ❖ GitHubʹϗετ͞ΕͨLinuxڥͰΈ࣮ߦͰ͖·͢ɻ ❖ JavaScript ❖
࣮ߦʹ༻͞ΕΔڥ͔ΒΓ͚Δ͜ͱ͕Ͱ͖Δ ❖ GitHubʹϗετ͞ΕͨLinuxɺMacOSɺWindowsͷԾϚ γϯͰՔಇ
ϚϚϦΞϓϦͰͷΞΫγϣϯ ❖ ϦϙδτϦΞΫγϣϯ ❖ ϦϦʔεϒϥϯνΛpushͨ࣌͠ʹࣗಈͰPRΛ࡞Δ ❖ ϦϦʔεϒϥϯνΛϚʔδͨ࣌͠ʹࣗಈͰRelease NoteΛ࡞Δ ❖ OSSͷΞΫγϣϯ
❖ ϦϙδτϦͷcheckout ❖ SlackʹϦϦʔε༰ͷ௨Λ͢Δ
ϫʔΫϑϩʔ ϫʔΫϑϩʔ createReleaseNote Checkout on PR event ❖ Ϛʔδͨ࣌͠ʹࣗಈͰRelease NoteΛ࡞Δ
❖ Step1. ϦϙδτϦΛνΣοΫΞ τ ❖ Step2. ϦϦʔεϊʔτΛ࡞ ❖ ΞΫγϣϯͷதshell ϦϦʔεϊʔτ࡞
ϫʔΫϑϩʔ
ϫʔΫϑϩʔ masterϒϥϯν͚ͷ PR͕ด͡ΒΕͨ࣌ʹ
ϫʔΫϑϩʔ ϦϙδτϦΛ νΣοΫΞτͯ͠
ϫʔΫϑϩʔ ϦϦʔεϊʔτ࡞༻ͷ ΞΫγϣϯΛ࣮ߦ
ΞΫγϣϯ
ΞΫγϣϯ ϦϦʔεϊʔτຊจΛઃఆ
ΞΫγϣϯ PRͷΠϕϯτσʔλ͔Β ϨϙδτϦΛऔಘͯ͠
ΞΫγϣϯ CURLͰGithubAPIΛୟ͖ ϦϦʔεϊʔτ࡞
ΞΫγϣϯ TokenࣗಈͰڥมʹ ηοτ͞Ε͍ͯΔ
Ͱ͖ͨϦϦʔεϊʔτ
Ͱ͖ͨϦϦʔεϊʔτ Github ActionsͰ ࡞ΒΕͯΔͶʂ
ͨ͜͠ͱ ϚʔδͰͳ͘Close࣌ʹ τϦΨʔͯ͠͠·͏
ͨ͜͠ͱ ifΛͬͯɺϚʔδ࣌ʹ ݶఆͨ͠
·ͱΊ ❖ ϫʔΫϑϩʔࣗಈԽϓϩηεͷҰ࿈ͷखଓ͖ ❖ ΞΫγϣϯݸʑʹ࣮ߦ͢ΔλεΫ ❖ OSS͔Βࢀর/ࣗ࡞͕Ͱ͖Δ ❖ ϚϚϦΞϓϦͰͷར༻ࣄྫ
ͯ͞ɺ͜͜ͰએͰ͢ʂ
ࠓճͷ༰ͱશ͘ผͰ͢
͜͜ͰએͰ͢ʂ ࣗ࡞ΞΫγϣϯΛެ։ͨͧ͠ʂ
gradle-dependency-update-action ❖ ࠩͷ͋ΔgradleϑΝΠϧΛݩʹpull requestΛ࡞ͬͯ͘ ΕΔ ❖ Gradle Use Latest Versions
Pluginͷར༻Λલఔ ❖ ·ͩ·ͩࡶͳ࡞ΓͰ͢ ❖ ྑ͔ͬͨΒࢼͯ͠Έ͍ͯͩ͘͞ʂ
͍ͤͪ͝ΐ͏͋Γ͕ͱ͏ ͍͟͝·ͨ͠
Appendix ❖ yamlγϯλοΫε ❖ Πϕϯτͷछྨ ❖ https://github.com/katsutomu/gradle-dependency- update-action