Skip to content
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

Goreleaser setup #1279

Merged
merged 197 commits into from
Dec 5, 2022
Merged

Goreleaser setup #1279

merged 197 commits into from
Dec 5, 2022

Conversation

rakeshsharma14317
Copy link
Contributor

@rakeshsharma14317 rakeshsharma14317 commented Nov 22, 2022

Adding steps release using goreleaser with homebrew setup

  • Create a Github Repository for your homebrew tap
  • Create a Github personal access token and set it up as an Actions Secret
  • Add brew setup in a .goreleaser.yml file
  • Create your Github Actions workflow
  • Publish and try for testing
  • Cut a new demo release in brew my merging in main (@rakeshsharma14317)
  • Copy new build steps from make cli.prepare into GH action (@rakeshsharma14317)
  • Change trigger to tags (@rakeshsharma14317)
  • Set up Github releases with prelease: auto and draft: true – only after cutting a 0.16.0-rc.1 tag (@rakeshsharma14317)
  • Publish binaries to cdn.rilldata.com instead of pkg.rilldata.com – only after cutting a 0.16.0-rc.1 tag (@rakeshsharma14317)
  • Cut a 0.16.0-rc.1 release (@rakeshsharma14317)
  • Update curl install script to pull from Goreleaser artifacts – name and checksum formats have changed (@himadrisingh)
  • Set up nightly releases (@himadrisingh)
  • Describe release steps in CONTRIBUTING.md
  • Move to prod from staging (@himadrisingh) <= Important before merging

@rakeshsharma14317 rakeshsharma14317 changed the title goreleaser prototype setup [Draft] goreleaser prototype setup Nov 22, 2022
@rakeshsharma14317 rakeshsharma14317 force-pushed the goreleaser-prototype branch 3 times, most recently from 6bceaec to e53cbd4 Compare November 24, 2022 13:01
@rakeshsharma14317 rakeshsharma14317 force-pushed the goreleaser-prototype branch 2 times, most recently from 11c3667 to 487c712 Compare November 24, 2022 14:58
@rakeshsharma14317 rakeshsharma14317 force-pushed the goreleaser-prototype branch 2 times, most recently from 12cbcb6 to 8e8b1b1 Compare November 24, 2022 15:13
.goreleaser.yaml Outdated
draft: true

builds:
- id: darwin_amd4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be 64

Comment on lines 4 to 5
schedule:
- cron: "0 0 * * *"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the point of having this now? Shouldn't it be for nightlies only (which aren't set up yet)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@himadrisingh Do we need this?

Comment on lines +30 to +34
goarch:
- arm64
env:
- PKG_CONFIG_SYSROOT_DIR=/sysroot/macos/amd64
- PKG_CONFIG_PATH=/sysroot/macos/amd64/usr/local/lib/pkgconfig
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rakeshsharma14317, can you do some research and share your findings on possible implications of using a amd64 sysroot for an arm64 build target? Probably it's fine, just want to be sure – I don't know much about this

.goreleaser.yaml Outdated
Comment on lines 93 to 100
archives:
- replacements:
darwin: Darwin
linux: Linux
files:
- README.md
- LICENSE*
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is producing binary names with uppercase OS, see the screenshot. They should be all lowercase, e.g. rill_darwin_arm64.tar.gz

Also: Is there a way to output .zip files instead of .tar.gz? It's just more common/easy for people

Screenshot 2022-12-05 at 11 35 23

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@begelundmuller sure making it lowercase,
But on you second comment, what i found is mostly for mac and linux everyone prefers .tar.gz Only for window good to have .zip

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rakeshsharma14317 can you find out how to do zip and then will discuss options with product. But I think they'll prefer .zip, it's now very common on unix systems. E.g. duckdb only publishes .zip archives

.goreleaser.yaml Outdated
Comment on lines 108 to 113
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these excludes match commit messages? We don't use prefixes for commit messages like this, so they'll have no effect. Is there a way to match paths instead?

Copy link
Contributor Author

@rakeshsharma14317 rakeshsharma14317 Dec 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah as per their documentation we have

for e.g:

-# Paths to filter the commits for.
-# Only works when use: git, otherwise ignored.
-# Only on GoReleaser Pro.
-#
-# Default: monorepo.dir value, or empty if no monorepo.
-# Since: v1.12.0-pro
paths:

  • foo/
  • bar/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But looks like its for GoReleaser Pro.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now removing filters as its of no use

Comment on lines 9 to 14
# branches: [ "goreleaser-prototype" ]
# paths:
# - ".github/workflows/cli-release.yml"
# - ".goreleaser.yaml"
# - "go.mod"
# - "cli/**"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove this now

flags:
- "-mod=readonly"
ldflags:
- -s -w -X main.Version={{.Version}} -X main.Commit={{.ShortCommit}} -X main.BuildDate={{.Date}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this, and noticed that running rill version outputs the correct version and commit hash, but for the build date, it outputs the current time, not the build time. Can you fix this? I think it might be because of the assignment in main.go, but not sure – maybe just have it be the zero time (var BuildDate time.Time) instead of time.Now()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it is because of assignment in main.go

.goreleaser.yaml Outdated Show resolved Hide resolved
.goreleaser.yaml Outdated Show resolved Hide resolved
.goreleaser.yaml Outdated Show resolved Hide resolved
@rakeshsharma14317 rakeshsharma14317 merged commit 65885f9 into main Dec 5, 2022
@rakeshsharma14317 rakeshsharma14317 deleted the goreleaser-prototype branch December 5, 2022 19:15
djbarnwal pushed a commit that referenced this pull request Aug 3, 2023
* goreleaser prototype setup

* using goreleaser-cross to cross-compile for other platform

* added formatting in yaml file

* prettier

* adding homebrew tap to cli

* goreleaser homebrew setup fix

* adding sysroot as submodule

* adding sysroot as submodule

* add submodule

* added access token and created tap repo

* build a snapshot

* Update .goreleaser.yaml

* update Makefile

* add gcs support

- remove makefile
- formatting

* snapshot wont upload

* no release as of now

* revert: fetch tags

* gitignore

error=git is in a dirty state

* Skips git checks

* disable scm release

* typo

* adding back the makefile for cli and proto

* requested PR changes

* Install npm

* disable submodules on travis

* make it pretty

* node16

* version missing npm

* goreleaser

:facepalm:

* curl

* typo

* testing without goreleaser-cross

* commenting npm install step

* commenting env vars in goreleaser.yaml

* updating cobra cli version

* update GH action

* update go version

* build both arm/amd

* build linux too

* nodejs

* only macos

* build linux too

* testing with args to goreleaser.yaml

* reverting changes

* uncommenting linux build as in goreleaser

* test goos in env vars

* Reverting changes

* testing with diff .goreleaser files

* Update .goreleaser.yaml

* cleanup

* remove sysroot

* another cleanup

* Update .goreleaser.linux.yaml

* upload for nightly

* upload to gcs at particular path

* Update .github/workflows/cli-release.yml

* release via cross compile example

* removed docker from makefile

* adding secrets env

* cleanup

* fix tabs

* Update .github/workflows/cli-release.yml

* comment wrap_in_directory

* checksum

* typo

* brew url template

* fix yaml

* Update .goreleaser.yaml

* Update .goreleaser.yaml

* fixing installation from homebrew

* Update cli-release.yml

* move make cli to workflow

* Update cli-release.yml

* tabs

* new name

* updated binary name and added makefile

* fixed .goreleaser

* added make cli

* adding pre hooks

* prettier fix

* embed

* dont remove dist

* debug

* Update .goreleaser.yaml

* copy contents

* try adding mime

* go mod tidy

* UI embed fix

* go fmt ./..

* Apply suggestions from code review

* Update .goreleaser.yaml

* try snapshot for nightlies?

* add arm64

* upload to latest too

* upload all

* goreleaser prototype setup

* using goreleaser-cross to cross-compile for other platform

* added formatting in yaml file

* prettier

* adding homebrew tap to cli

* goreleaser homebrew setup fix

* adding sysroot as submodule

* add submodule

* adding sysroot as submodule

* added access token and created tap repo

* build a snapshot

* Update .goreleaser.yaml

* update Makefile

* add gcs support

- remove makefile
- formatting

* snapshot wont upload

* no release as of now

* gitignore

error=git is in a dirty state

* Skips git checks

* disable scm release

* typo

* adding back the makefile for cli and proto

* requested PR changes

* Install npm

* disable submodules on travis

* make it pretty

* node16

* version missing npm

* goreleaser

:facepalm:

* curl

* typo

* testing without goreleaser-cross

* commenting npm install step

* commenting env vars in goreleaser.yaml

* updating cobra cli version

* update GH action

* build both arm/amd

* build linux too

* only macos

* build linux too

* testing with args to goreleaser.yaml

* reverting changes

* uncommenting linux build as in goreleaser

* test goos in env vars

* Reverting changes

* testing with diff .goreleaser files

* cleanup

* remove sysroot

* another cleanup

* upload for nightly

* Update .goreleaser.linux.yaml

* upload to gcs at particular path

* Update .github/workflows/cli-release.yml

* release via cross compile example

* removed docker from makefile

* adding secrets env

* cleanup

* comment wrap_in_directory

* checksum

* typo

* brew url template

* fix yaml

* Update .goreleaser.yaml

* Update .goreleaser.yaml

* fixing installation from homebrew

* Update cli-release.yml

* new name

* updated binary name and added makefile

* fixed .goreleaser

* prettier fix

* dont remove dist

* debug

* copy contents

* try adding mime

* go mod tidy

* Apply suggestions from code review

* Update .goreleaser.yaml

* try snapshot for nightlies?

* add arm64

* Update cli-release.yml

* Update .goreleaser.yaml

* go mod tidy

* .goreleaser.yaml id name

* updating GH action with make cli.prepare

* typo

* Update Makefile

* Update .goreleaser.yaml

* Update cli-release.yml

* Update cli-release.yml

* only on tags

* ignore sysroot/

* requested changes

* removed cron

* Apply suggestions from code review

Co-authored-by: Himadri Singh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants