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
220
GitHub Actionsのカスタムアクションを公開する
yorifuji
December 14, 2023
Tweet
Share
More Decks by yorifuji
See All by yorifuji
GitHub Actionsのカスタムアクションを作成してMarketplaceで公開した話
yorifuji
0
120
Flutter開発とGitHub Actions
yorifuji
0
200
iOSアプリ開発でGitHub Actionsのself-hosted runnerを使う
yorifuji
1
1.3k
Other Decks in Programming
See All in Programming
AWSマネコンに複数のアカウントで入れるようになりました
yuhta28
2
150
Terraform で作る Amazon ECS の CI/CD パイプライン
hiyanger
0
110
GitHub CopilotでTypeScriptの コード生成するワザップ
starfish719
28
6.1k
EC2からECSへ 念願のコンテナ移行と巨大レガシーPHPアプリケーションの再構築
sumiyae
3
620
振り返れば奴(Cline)がいる
keiyagi
0
110
ペアーズでの、Langfuseを中心とした評価ドリブンなリリースサイクルのご紹介
fukubaka0825
1
180
ATDDで素早く安定した デリバリを実現しよう!
tonnsama
1
2.4k
Оптимизируем производительность блока Казначейство
lamodatech
0
990
カンファレンス動画鑑賞会のススメ / Osaka.swift #1
hironytic
0
200
Fibonacci Function Gallery - Part 2
philipschwarz
PRO
0
220
SwiftUIで単方向アーキテクチャを導入して得られた成果
takuyaosawa
0
120
Amazon ECS とマイクロサービスから考えるシステム構成
hiyanger
1
130
Featured
See All Featured
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Practical Orchestrator
shlominoach
186
10k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
The Language of Interfaces
destraynor
156
24k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Testing 201, or: Great Expectations
jmmastey
41
7.2k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
98
18k
Adopting Sorbet at Scale
ufuk
74
9.2k
Thoughts on Productivity
jonyablonski
68
4.4k
The Invisible Side of Design
smashingmag
299
50k
Embracing the Ebb and Flow
colly
84
4.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ͷνΣοΫ
ެ։🎉
͋Γ͕ͱ͏͍͟͝·ͨ͠