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
仕事でGoで書いたWindows向けの小さなアプリをAppVeyorを使ってCIした話
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Daichi Hioki
March 27, 2019
Technology
260
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
仕事でGoで書いたWindows向けの小さなアプリをAppVeyorを使ってCIした話
第8回ゆるはち.it: CI/CDについてゆるく話す -
https://yuruhachi-it.connpass.com/event/123888/
での LT 資料です。
Daichi Hioki
March 27, 2019
More Decks by Daichi Hioki
See All by Daichi Hioki
Rustで学ぶTOTP
hioki_daichi
0
1.3k
Gopher道場#3を振り返る
hioki_daichi
0
2.6k
Rubyエンジニア多めの現場での Vue.js1系 on Rails
hioki_daichi
5
1.3k
Other Decks in Technology
See All in Technology
攻撃者視点で考えるDetection Engineering
cryptopeg
3
2k
気軽に使える"情報のハブ"としてのNotion活用 〜フロー情報の集積点 と、 Claude Code × Notion AI〜
syucream
1
160
Bucharest Tech Week 2026 - Guardians of the Cloud-Native Galaxy
edeandrea
PRO
0
130
Agent Skills設計で柔軟性と硬さのバランスが難しい話
nassy20
0
150
Oracle AI Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
6
1.6k
徹底討論!ECS vs EKS!
daitak
3
1.1k
白金鉱業Meetup_Vol.24_「AIエージェントは分けるほど良い」は本当か? / Is it true that “the more you divide AI agents, the better”?
brainpadpr
1
420
クレデンシャル流出 ― 攻撃 3 時間 vs 復旧 10 時間。この非対称性にどう備えるか
kazzpapa3
2
240
スタートアップにAmazon EKSは早すぎる? マルチプロダクト戦略を加速する Platform Engineeringの実践 / Is Amazon EKS Too Soon for Startups? Practical Platform Engineering to Accelerate a Multi-Product Strategy
elmodev09
1
760
脱SaaS!FDEを支えるプロビジョニングと分離設計
knih
0
250
SONiC Scale-Up Working Group から探る Scale-UpやUltraEthernet機能の実装方法
ebiken
PRO
2
420
新しいUbuntu/GNOMEが使いたいからXからWaylandへ移行頑張ってるの巻 2026-06-20
nobutomurata
0
150
Featured
See All Featured
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.5k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
610
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
440
Mind Mapping
helmedeiros
PRO
1
260
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
590
Making the Leap to Tech Lead
cromwellryan
135
9.9k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
240
Amusing Abliteration
ianozsvald
1
210
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.5k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
560
Designing for Timeless Needs
cassininazir
1
260
Visualization
eitanlees
152
17k
Transcript
仕事でGoで書いたWindows 向けの小さなアプリを AppVeyorを使ってCIした話
自己紹介 - 株式会社クリプラでクラウド電子カルテを開発している Rails エンジニア - https://clipla.jp/ - 最近は Go
で Windows 向けアプリを作成中 - こちらにまつわる CI のご紹介
AppVeyor とは - Windows 環境の CI ができるやつ - (Windows 以外も対応してるけど・・)
- 価格 - Public なリポジトリなら無料 - 2019年3月時点で Private なリポジトリ は $29/month
設定方法 - Web からでも YAML でも 設定可能 - Web の場合は→
- YAMLの場合は appveyor.yml で
設定方法 - Web で設定したものを YAML へ Export するこ とも可能
Build Worker Image - 現時点でのデフォルト: - Visual Studio 2015 -
ubuntu 等も選択可能 - ubuntu を Worker Image に 使った Getting started ページも ある - Getting started with AppVeyor for Linux | AppVeyor
Stack (※ 今回は使わず) - stack: go 1.11 のように指定すること で公式の用意した Go
を使える
Build Cache - 指定したディレクトリやファイルの内容をビルド間で保持できる 機能
AppVeyor でテストを行う例
appveyor.yml に変更があったら cache からの restore を skip する こちらは Windows
のコマンド > https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/if if [not] exist <FileName> <Command> [else <Expression>] 公式でまだ Go1.12 がサポートされていないためソースからインストール msiexec /i でインストール https://docs.microsoft.com/ja-jp/windows/desktop/Msi/command-line-options あらかじめ environment の箇所で環境変数 GOBIN を c:\gobin に設定しているため、$ go install した時に c:\gobin 以下にツールをインストールしてくれる どこでもよさそう。Go の Modules 導入以前は制限があったかも。 Go のモジュールシステムが過渡期なのでこのような指定が必要 詳細: https://github.com/golang/go/wiki/Modules
AppVeyor に GoReleaser を組み合わせることで tag を push した時に自動で GitHub Releases
に Publish する例
if %APPVEYOR_REPO_TAG% equ true <コマンド> で tag を push した時だけ実行したいコマンドを定義できる
deploy_script 内での goreleaser release の実行
GoReleaser の設定ファイルは .goreleaser.yaml - builds の goos と goarch で
指定した組み合わせをすべ て生成してくれる - 右の例では 6 通り
GoReleaser には環境変数 GITHUB_TOKEN が必要 - GoReleaser を使ってリリースするためには repo の scope
を 持った GitHub token を環境変数 GITHUB_TOKEN に設定 する必要がある
GitHub token の作成 - https://github.com/settings/tokens/new で作るだけ
AppVeyor で環境変数 GITHUB_TOKEN を指定する
あとは tag を push するだけ - tag を push するだけで
GitHub Releases にリリース が作成される
まとめ
- 話したこと - AppVeyor の概要: - 設定方法、Build Worker Image、Stack、Build Cache
- プロジェクトでの実例: - Go1.12 をソースからインストールして statik もインストールしてテスト - AppVeyor + GoReleaser: - AppVeyor と GoReleaser を組み合わせて、tag を push した時に自動で GitHub Releases に publish - その他 - 今回試していなかったけれど、コードが大きい場合は Azure Pipelines の方が良い かも? - https://azure.microsoft.com/ja-jp/services/devops/pipelines/ - Public なリポジトリなら無料で 10 個の並列ジョブ(時間制限なし)を実行可能ら しい