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
GitHub Actionsのカスタムアクションを公開する
Search
yorifuji
December 14, 2023
Programming
0
200
GitHub Actionsのカスタムアクションを公開する
yorifuji
December 14, 2023
Tweet
Share
More Decks by yorifuji
See All by yorifuji
GitHub Actionsのカスタムアクションを作成してMarketplaceで公開した話
yorifuji
0
100
Flutter開発とGitHub Actions
yorifuji
0
180
iOSアプリ開発でGitHub Actionsのself-hosted runnerを使う
yorifuji
1
1.3k
Other Decks in Programming
See All in Programming
WebフロントエンドにおけるGraphQL(あるいはバックエンドのAPI)との向き合い方 / #241106_plk_frontend
izumin5210
4
1.4k
CSC509 Lecture 11
javiergs
PRO
0
180
EventSourcingの理想と現実
wenas
6
2.3k
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
310
初めてDefinitelyTypedにPRを出した話
syumai
0
400
Better Code Design in PHP
afilina
PRO
0
120
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
110
タクシーアプリ『GO』のリアルタイムデータ分析基盤における機械学習サービスの活用
mot_techtalk
4
1.3k
GitHub Actionsのキャッシュと手を挙げることの大切さとそれに必要なこと
satoshi256kbyte
5
430
シェーダーで魅せるMapLibreの動的ラスタータイル
satoshi7190
1
480
Pinia Colada が実現するスマートな非同期処理
naokihaba
4
220
C++でシェーダを書く
fadis
6
4.1k
Featured
See All Featured
Music & Morning Musume
bryan
46
6.2k
Why Our Code Smells
bkeepers
PRO
334
57k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
How to Think Like a Performance Engineer
csswizardry
20
1.1k
What's in a price? How to price your products and services
michaelherold
243
12k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Being A Developer After 40
akosma
86
590k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
The Pragmatic Product Professional
lauravandoore
31
6.3k
Faster Mobile Websites
deanohume
305
30k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
Transcript
GitHub ActionsͷΧελϜΞΫγϣϯΛެ։͢Δ 2023.12.14 YORIFUJI MITSUNORI
ࣗݾհ • YORIFUJI MITSUNORI • @yorifuji on X / GitHub
/ Zenn • ۚ༥ܥελʔτΞοϓͷiOSΤϯδχΞ
ࠓͷൃදͪ͜ΒͷهࣄΛϕʔεʹͨ͠༰ʹͳΓ·͢ https://zenn.dev/yorifuji/articles/feec2c0294c7f9
GitHub Actions https://github.co.jp/features/actions
GitHub ActionsͰFlutterͷ ੩తղੳΛ࣮ߦ͢ΔϫʔΫ ϑϩʔͷྫʢyamlϑΝΠ ϧʣ name: check on: pull_request permissions:
contents: read jobs: analysis: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2 - run: flutter pub get - run: flutter analyze
ࠓճϫʔΫϑϩʔͷ࡞Γ ํͰͳ͘ɺϫʔΫϑϩʔ Ͱར༻͢ΔΞΫγϣϯΛ࡞ ͢Δ name: check on: pull_request permissions: contents:
read jobs: analysis: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2 - run: flutter pub get - run: flutter analyze
ࢲ͕࡞ɾެ։ͨ͠ΞΫγϣϯͪ͜Β☝ https://github.com/marketplace/actions/ fl utter-analyze-commenter
CIʢ੩తղੳʣ͕ࣦഊͨ࣌͠ʹϩάͷ༰Λ֬ೝ͢Δͷ໘
Flutterͷιʔείʔυͷ੩తղੳͷ ݁ՌΛPull RequestʹϨϏϡʔίϝ ϯτͱͯ͠ॻ͖ࠐΉΞΫγϣϯΛ࡞ ͠·ͨ͠
͍ํϫʔΫϑϩʔʹ ΞΫγϣϯΛՃ͢Δͩ ͚ name: flutter-analyze-commenter example on: pull_request permissions: contents:
read pull-requests: write jobs: analysis: runs-on: ubuntu-latest steps: ... - run: flutter analyze --write=flutter_analyze.log - uses: yorifuji/flutter-analyze-commenter@v1 if: ${{ !cancelled() }} with: analyze_log: flutter_analyze.log
ݩʑผͷπʔϧΛར༻͍ͯͨ͠ • Problem MatchersͱDangerΛΈ߹Θͤͯಉ༷ͷ࡞ۀΛߦͳ͍ͬͯͨ • ҎԼͷ͕ෆຬ • 2ͭπʔϧͰίϝϯτͷϑΥʔϚοτͷڍಈʹҧ͍͕͋Δ • ϫʔΫϑϩʔͷଞʹϑΝΠϧͷஔͳͲͷηοτΞοϓ͕ඞཁ
• DangerߴػೳͰଟ༻్Ͱ͋Δ໘ɺRubyͷґଘϥΠϒϥϦͷΠϯε τʔϧ͕ඞཁɺΦʔόʔεϖοΫʹײ͍ͯͨ͡
࡞ͨ͠ΞΫγϣϯͷΓ͑ͰআͰ͖ͨϑΝΠϧɾϫʔΫϑϩʔͷهड़
ΞΫγϣϯΛ࡞ͬͯެ։͢Δํ๏
GitHub Marketplace • GitHubެࣜɾOSSͷGitHub AppsΞΫγϣϯ͕ެ։͞Ε͍ͯΔ • ୳ͤඞཁͳͷେମ͋Δ • Ϩϐϡςʔγϣϯʢ⭐ʣ͕গͳ͍ϚΠφʔͳActionΛར༻͢Δͱ͖ ηΩϡϦςΟϦεΫͳͲʹҙ
MarketplaceʹΞΫγϣϯΛొ͢Δखॱ • ͜Ε͚ͩ • GitHubʹpublic repositoryΛ࡞ • ΞΫγϣϯͷఆٛΛॻ͍ͨaction.ymlΛ࡞ • ΧελϜΞΫγϣϯͷॲཧΛ࣮
• GitHub্ͰReleaseΛ࡞ͯ͠ެ։ • ৄ͍͠खॱͪ͜Β • https://docs.github.com/ja/actions/creating-actions/publishing-actions-in-github- marketplace
action.yml ͷهड़ྫʢ࣮ࡍͷΞΫγϣϯ͔Βൈਮʣ name: "Flutter Analyze Commenter" description: "Auto comment on
PRs based on Flutter Analyze results" inputs: analyze_log: description: "Path to the Flutter analyze log" required: true runs: using: composite steps: - uses: actions/github-script@v7 env: ANALYZE_LOG: ${{ inputs.analyze_log }} VERBOSE: ${{ inputs.verbose }} with: script: | const analyzeLog = process.env.ANALYZE_LOG; ...
ΧελϜΞΫγϣϯͷ࣮ํ๏ • Docker ίϯςφʔ ΞΫγϣϯ • ίϯςφΛ࣮ͬͯߦڥΛύοέʔδԽ͢Δํࣜ • ඞཁͳπʔϧґଘؔΛίϯςφͰཧͰ͖ΔͷͰҰ؏ੑͱ৴པੑΛ୲อ͍͢͠ •
ݱঢ়Linuxʢubuntuʣ ͷϥϯφʔͰͷΈར༻Ͱ͖ΔʢmacOSWindowsར༻ෆՄʣ • JavaScript ΞΫγϣϯ • Node.jsΛͬͯJavaScriptͷίʔυΛ࣮ߦ͢ΔΞΫγϣϯ • TypeScriptͰͷ։ൃՄೳʢ࠷ऴతʹJavaScript͕ੜͰ͖ΔͳΒͳΜͰྑ͍ʣɺෳࡶͳ࣮Λ͢ΔͳΒ͓͢͢Ί • ෳ߹ΞΫγϣϯʢComosite Actionʣ • ීஈ͍ͬͯΔϫʔΫϑϩʔ͔ΒॲཧΛΓग़͢Πϝʔδ • γΣϧεΫϦϓτͰͷ࣮͕جຊ • uses: ͕ར༻ՄೳͳͷͰ௨ৗͷΞΫγϣϯར༻Ͱ͖Δ
actions/github-script // ྫɿhello world - uses: actions/github-script@v7 with: script: console.log('Hello,
JavaScript') // ྫɿGithubͷREST APIΛͬͯIssueΛऔಘ - uses: actions/github-script@v7 with: script: | github.rest.issues.get({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, }) • ෳ߹ΞΫγϣϯͰJavaScriptΛͬͨॲ ཧΛهड़Ͱ͖ΔΞΫγϣϯ
࡞ͨ͠ΧελϜΞΫγϣϯͷ࣮ৄࡉ • Flutterͷ੩తղੳͷग़ྗ༰ʢςΩετʣΛղੳͯ͠ϑΝΠϧ໊ɺߦ൪߸ɺ ϝοηʔδʢܯࠂʣͳͲΛऔಘ͢Δ • ϑΝΠϧ໊ɾߦ൪߸ɾϝοηʔδΛͱʹGitHubͷREST APIΛͬͯPRʹ ରͯ͠ॻ͖ࠐΉ • PRʹରͯ͠मਖ਼ʢՃʣίϛοτ͕ൃੜͨ͠Βݹ͘ͳͬͨʢOutdatedͳʣ
ίϝϯτΛߋ৽ or আ • PR͔ΒίϝϯτΛશ݅औಘͯ͠࠷৽ͷ੩తղੳͷ݁Ռͱಥ߹
ϦϦʔε࡞ۀ • ։ൃ͕ऴΘͬͨΒGitHub্ͰReleaseΛ ࡞͢Δ • ϦϙδτϦͷτοϓʹaction.yml͕ଘࡏ ͢ΔͱΞΫγϣϯઐ༻ͷReleaseը໘͕ දࣔ͞ΕΔ • MarketplaceͷpublishΛࢦఆͰ͖Δ
• ymlهड़༰ɺREADMEͷνΣοΫ
ެ։🎉
͋Γ͕ͱ͏͍͟͝·ͨ͠