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
190
GitHub Actionsのカスタムアクションを公開する
yorifuji
December 14, 2023
Tweet
Share
More Decks by yorifuji
See All by yorifuji
GitHub Actionsのカスタムアクションを作成してMarketplaceで公開した話
yorifuji
0
97
Flutter開発とGitHub Actions
yorifuji
0
170
iOSアプリ開発でGitHub Actionsのself-hosted runnerを使う
yorifuji
1
1.3k
Other Decks in Programming
See All in Programming
カラム追加で増えるActiveRecordのメモリサイズ イメージできますか?
asayamakk
4
1.5k
Universal Linksの実装方法と陥りがちな罠
kaitokudou
1
220
Golang と Erlang
taiyow
8
1.9k
Why Spring Matters to Jakarta EE - and Vice Versa
ivargrimstad
0
870
Mastering Dependencies in Kotlin Multiplatform
tomifabian
0
100
Nuxt UI Pro、NuxtHub、Nuxt Scripts、Nuxtエコシステムをふんだんに利用して開発するコーポレートサイト@Vue Fes Japan 2024
shingangan
3
870
組織に自動テストを書く文化を根付かせる戦略(2024秋版) / Building Automated Test Culture 2024 Autumn Edition
twada
PRO
10
4.5k
レガシーな Android アプリのリアーキテクチャ戦略
oidy
1
170
Vue3の一歩踏み込んだパフォーマンスチューニング2024
hal_spidernight
3
3.1k
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
150
Vaporモードを大規模サービスに最速導入して学びを共有する
kazukishimamoto
4
4.3k
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
310
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
53
9k
A designer walks into a library…
pauljervisheath
202
24k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
27
1.9k
Statistics for Hackers
jakevdp
796
220k
Designing Experiences People Love
moore
138
23k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Bash Introduction
62gerente
608
210k
Designing for humans not robots
tammielis
249
25k
10 Git Anti Patterns You Should be Aware of
lemiorhan
654
59k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
9
670
Optimising Largest Contentful Paint
csswizardry
33
2.9k
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ͷνΣοΫ
ެ։🎉
͋Γ͕ͱ͏͍͟͝·ͨ͠