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
Building and Releasing Golang binaries
Search
Carlos Alexandro Becker
September 21, 2017
Technology
1
2.2k
Building and Releasing Golang binaries
Carlos Alexandro Becker
September 21, 2017
Tweet
Share
More Decks by Carlos Alexandro Becker
See All by Carlos Alexandro Becker
construindo uma carreira com opensource
caarlos0
0
340
Introdução ao GoReleaser
caarlos0
0
1.1k
Intro to GoReleaser
caarlos0
0
1.1k
Intro to GoReleaser
caarlos0
0
1.5k
Gerenciando Projetos OpenSource
caarlos0
0
1.4k
GoReleaser: Lessons Learned (hacktoberfest)
caarlos0
0
1.8k
GoReleaser: Lessons Learned
caarlos0
0
2.4k
Go 1.10 Release Party @ Joinville Go Meetup
caarlos0
0
2.1k
Monitoring @ ContaAzul
caarlos0
0
2.2k
Other Decks in Technology
See All in Technology
Linuxのブートプロセス
sat
PRO
6
100
スクラムというコンフォートゾーンから抜け出そう!プロジェクト全体に目を向けるインセプションデッキ / Inception Deck for seeing the whole project
takaking22
3
240
Amazon Athenaから利用時のGlueのIcebergテーブルのメンテナンスについて
nayuts
0
130
RaspberryPi CM4(CM5も)面白いぞ!
nonnoise
1
250
早くて強い「リアルタイム解析基盤」から広げるマルチドメイン&プロダクト開発
plaidtech
PRO
1
120
マーケットプレイス版Oracle WebCenter Content For OCI
oracle4engineer
PRO
3
550
アジャイルな開発チームでテスト戦略の話は誰がする? / Who Talks About Test Strategy?
ak1210
1
910
プルリクエストレビューを終わらせるためのチーム体制 / The Team for Completing Pull Request Reviews
nekonenene
4
2k
Real World Nix CI/CD編
asa1984
1
120
AWSではじめる Web APIテスト実践ガイド / A practical guide to testing Web APIs on AWS
yokawasa
8
830
“常に進化する”開発現場へ! SHIFTが語るアジャイルQAの未来/20250306 Yuma Murase
shift_evolve
0
160
Amazon Bedrock Knowledge basesにLangfuse導入してみた
sonoda_mj
2
270
Featured
See All Featured
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Adopting Sorbet at Scale
ufuk
75
9.2k
Statistics for Hackers
jakevdp
797
220k
Into the Great Unknown - MozCon
thekraken
35
1.7k
Side Projects
sachag
452
42k
Product Roadmaps are Hard
iamctodd
PRO
51
11k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
6
580
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Typedesign – Prime Four
hannesfritz
41
2.5k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
115
51k
Site-Speed That Sticks
csswizardry
4
420
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
28
1.9k
Transcript
BUILDING AND RELEASING GOLANG BINARIES #1 CHANGELOG
TEXT $ WHOAMI ▸ Site Reliability Engineer @ ContaAzul ▸
@caarlos0 on twitter, github, etc ▸ Writing stuff in Go since ~2015
BUILDING AND RELEASING GOLANG BINARIES #1 CHANGELOG
TEXT AGENDA ▸ Building ▸ Releasing ▸ Automation ▸ Questions
BUILDING
BUILDING CROSS-COMPILING GO ▸ Go can build from and to
basically any platform ▸ Statically linked binaries (no deps!!!) ▸ GOOS=windows GOARCH=amd64 go build -o blah_win64 GOOS=linux GOARCH=amd64 go build -o blah_linux64 GOOS=darwin GOARCH=amd64 go build -o blah_darwin64 ...
RELEASING
RELEASING LINUX PACKAGES ▸ DEB and RPM packages ▸ fpm
--a-thousand-params ▸ Snaps ▸ snapcraft --another-thousand-params config.yml
RELEASING HOMEBREW ▸ Homebrew core ▸ Harder to get things
in there: licensing, replicating dependencies into the recipe, etc ▸ brew install mytool ▸ Homebrew taps ▸ brew install caarlos0/tap/mytool
RELEASING DOCKER ▸ FROM scratch COPY mybin / ENTRYPOINT ["/mybin"]
▸ docker build -t user/img:tag . ▸ docker tag user/img:tag user/img:latest ▸ docker push user/img:tag ▸ docker push user/img:latest
RELEASING GITHUB RELEASES ▸ git tag && git push ▸
Upload artifacts ▸ Generate and upload checksums maybe ▸ Edit the release notes
"THE PROCESS"
TEXT RELEASING MY GO APP THE FIRST TIME: ▸ Tag
▸ Cross compile ▸ Checksums ▸ Release notes ▸ .deb, .rpm, .snap ▸ docker images ▸ Upload ▸ Update homebrew tap
HMM, THAT'S ACTUALLY NOT THAT BAD! Carlos Becker TEXT
TEXT RELEASING MY GO APP FOR THE 10TH TIME: ▸
Tag ▸ Cross compile ▸ Checksums ▸ Release notes ▸ .deb, .rpm, .snap ▸ docker images ▸ Upload ▸ Update homebrew tap
None
None
None
None
... Carlos Becker TEXT
None
None
AUTOMATION INTENSIFIES
TEXT ./RELEASE.SH ▸ Copy-paste all the commands in one file
▸ chmod +x ▸ ./release.sh
TEXT ./RELEASE.SH ▸ No parallelism ▸ Every repo has its
own release.sh ▸ GNU vs BSD coreutils aka "Works on my machine" ▸ Random deps or really hacky scripts
None
GORELEASER INTRODUCING
GORELEASER FEATURES ▸ Checks git state ▸ Changelog between tags
▸ Builds for several platforms ▸ Archiving (tar.gz, zip) ▸ FPM, Snapcraft and Docker integration ▸ Homebrew taps ▸ Checksums ▸ Snapshots ▸ Fairly customisable
GORELEASER INIT ▸ goreleaser init ▸ vim .goreleaser.yml ▸ git
add .goreleaser.yml ▸ git commit -m 'goreleaser setup!'
GORELEASER RELEASE PROCESS ▸ git tag x.y.z ▸ git push
x.y.z ▸ goreleaser
GORELEASER CI INTEGRATION ▸ after_success: test -n "$TRAVIS_TAG" && curl
-fsL https://git.io/goreleaser | bash ▸ Push the tag ▸ Drink some coffee
None
None
HOW IT WORKS
None
None
None
None
GORELEASER WHY BOTHER ▸ Easy release process ▸ More releases
▸ Smaller changes ▸ Reproducible releases ▸ Fewer and more traceable bugs ▸ Same process across multiple repos ▸ Focus on your code
STATS
"THATS NICE, BUT NO ONE WILL GIVE A CRAP ABOUT
IT ANYWAY..." Carlos Becker TEXT
Generated with caarlos0/starcharts
Generated with goreleaser/users
THANKS!
QUESTIONS?
GORELEASER LINKS ▸ https://goreleaser.com ▸ #goreleaser on https://gophers.slack.com ▸ https://github.com/goreleaser/goreleaser
▸ https://github.com/goreleaser/users ▸ https://github.com/caarlos0/starcharts ▸ https://brew.sh ▸ http://snapcraft.io ▸ https://github.com/jordansissel/fpm