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
210
GitHub Actionsのカスタムアクションを公開する
yorifuji
December 14, 2023
Tweet
Share
More Decks by yorifuji
See All by yorifuji
GitHub Actionsのカスタムアクションを作成してMarketplaceで公開した話
yorifuji
0
110
Flutter開発とGitHub Actions
yorifuji
0
190
iOSアプリ開発でGitHub Actionsのself-hosted runnerを使う
yorifuji
1
1.3k
Other Decks in Programming
See All in Programming
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
120
今からはじめるAndroidアプリ開発 2024 / DevFest 2024
star_zero
0
1k
14 Years of iOS: Lessons and Key Points
seyfoyun
1
770
命名をリントする
chiroruxx
1
380
フロントエンドのディレクトリ構成どうしてる? Feature-Sliced Design 導入体験談
osakatechlab
8
4.1k
As an Engineers, let's build the CRM system via LINE Official Account 2.0
clonn
1
670
.NET 9アプリをCGIとして レンタルサーバーで動かす
mayuki
1
770
Haze - Real time background blurring
chrisbanes
1
500
42 best practices for Symfony, a decade later
tucksaun
1
180
Fibonacci Function Gallery - Part 1
philipschwarz
PRO
0
200
これが俺の”自分戦略” プロセスを楽しんでいこう! - Developers CAREER Boost 2024
niftycorp
PRO
0
190
プロダクトの品質に コミットする / Commit to Product Quality
pekepek
2
760
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
How to train your dragon (web standard)
notwaldorf
88
5.7k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Done Done
chrislema
181
16k
Thoughts on Productivity
jonyablonski
67
4.4k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
95
17k
Typedesign – Prime Four
hannesfritz
40
2.4k
Building Your Own Lightsaber
phodgson
103
6.1k
Building Better People: How to give real-time feedback that sticks.
wjessup
365
19k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
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ͷνΣοΫ
ެ։🎉
͋Γ͕ͱ͏͍͟͝·ͨ͠