-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use "GoReleaser" #395
Use "GoReleaser" #395
Changes from 9 commits
0fa0d14
99f437a
32a67c7
ea4b35e
47be021
9bc6dd9
d8e98e1
dfbf8e9
2a1e543
fc702f3
d253718
39ed5dd
8166041
80f4b8d
238c214
bc06af0
4696adb
e5bc118
e155141
c90c6d4
240fd9d
3361f7e
d1cd7aa
3144dc8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
# Needed to create a Github release with archives. | ||
#permissions: | ||
# contents: write | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17 | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
# either 'goreleaser' (default) or 'goreleaser-pro' | ||
distribution: goreleaser | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# TODO: Need a custom personal access token to allow publishing to | ||
# the deref/homebrew-tap repository. | ||
# GITHUB_TOKEN: ${{ secrets.GH_PAT }} | ||
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution | ||
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} | ||
|
||
- name: Get version from VERSION file | ||
id: get_version | ||
run: echo ::set-output name=release_version::$(cat VERSION | tr -d '[:space:]') | ||
|
||
- name: Update version in CloudFlare K/V | ||
uses: cloudflare/wrangler-action@1.3.0 | ||
with: | ||
apiToken: ${{ secrets.CF_API_TOKEN }} | ||
publish: false | ||
preCommands: wrangler kv:key put --binding VERSIONS "exo" ${{ steps.get_version.outputs.release_version }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,5 @@ | |
/.vscode/ | ||
/bin | ||
.DS_Store | ||
/exo | ||
/dist/ | ||
*.tsbuildinfo |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# Documentation for .goreleaser.yml can be found at <https://goreleaser.com>. | ||
--- | ||
before: | ||
hooks: | ||
- go mod tidy | ||
- make codegen | ||
#- make -C gui | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah yes, need to uncomment that — I just disabled it for testing. |
||
env: | ||
- CGO_ENABLED=0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If CGO_ENABLED is not 1, the build will succeed, but as soon as you try to open a Sqlite database, you'll encounter an error saying that CGO must be enabled. |
||
builds: | ||
# This is the build for use in the install script. | ||
- id: autoinstalled | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit picky: seems like an odd name for this. Does this name show up anywhere else? Like in the built files or whatever? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about "standalone"? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I was using the names from the files in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I think "standalone" is much clearer to me. Please change. Thanks! |
||
main: . | ||
goos: | ||
- linux | ||
- darwin | ||
tags: | ||
- bundle | ||
|
||
# This is the build for use by package managers. | ||
- id: managed | ||
main: . | ||
goos: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In addition to goos, we also need to build for goarch set to both amd64 and arm64, at least on darwin There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The default is to build for arm64, amd64 and i386: https://goreleaser.com/customization/build/ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need i386 support? Seems like that's extremely unlikely for any developer machine these days. I'd suggest dropping that and making this configuration explicit. |
||
- linux | ||
- darwin | ||
tags: | ||
- bundle | ||
- managed | ||
|
||
archives: | ||
- id: autoinstalled | ||
name_template: '{{ .ProjectName }}_autoinstalled_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}' | ||
builds: ["autoinstalled"] | ||
wrap_in_directory: true | ||
files: | ||
- LICENSE | ||
- NOTICES.md | ||
- VERSION | ||
- README.md | ||
- doc/* | ||
- id: managed | ||
name_template: '{{ .ProjectName }}_managed_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}' | ||
builds: ["managed"] | ||
wrap_in_directory: true | ||
files: | ||
- LICENSE | ||
- NOTICES.md | ||
- VERSION | ||
- README.md | ||
- doc/* | ||
|
||
checksum: | ||
name_template: "checksums.txt" | ||
|
||
snapshot: | ||
name_template: "{{ incpatch .Version }}-next" | ||
|
||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- "^docs:" | ||
- "^test:" | ||
|
||
brews: | ||
- name: exo | ||
ids: ["managed"] | ||
tap: | ||
owner: deref | ||
name: homebrew-tap | ||
commit_author: | ||
name: derefbot | ||
email: bot@deref.io | ||
homepage: "https://exo.deref.io" | ||
folder: Formula | ||
test: | | ||
system "#{bin}/exo version" | ||
|
||
nfpms: | ||
- builds: ["managed"] | ||
formats: | ||
- apk | ||
- deb | ||
- rpm | ||
|
||
release: | ||
github: | ||
owner: deref | ||
name: exo | ||
disable: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Presumably you need to uncomment this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I was going to see if it worked without it before I set that flag.