goreleaser github action
I saw your build script and I replaced it (via copy and paste from my other projects so there could be oversight sorry.) With a go-releaser version. It uses a build on tag strategy.
The output looks like this: https://github.com/arran4/triangle/releases/tag/v2.0.2
I'm getting the following error when I'm trying to build within your branch:
release failed after 0.03s error=git tag v2.0.0 was not made against commit c6ea05b53af40f095018ca5b2fcbf0b2340915b3
Where are you seeing that? When you try build it locally?
If so what flags are you using? If maybe use --snapshot as goreleaser expects that there are no uncommited changes and that if you don't put it in snapshot mode that the branch last commit matches the tag's commit.
Where are you seeing that? When you try build it locally?
Yes, I was trying to build it locally to check if it's working as expected. I was getting this error running the following command:
$ goreleaser release
$ goreleaser build --rm-dist --snapshot
• building...
• loading config file file=.goreleaser.yaml
• loading environment variables
• getting and validating git state
• building... commit=c6ea05b53af40f095018ca5b2fcbf0b2340915b3 latest tag=v2.0.2
• pipe skipped error=disabled during snapshot mode
• parsing tag
• setting defaults
• snapshotting
• github/gitlab/gitea releases
• project name
• loading go mod information
• building binaries
• creating source archive
• archives
• linux packages
• snapcraft packages
• calculating checksums
• signing artifacts
• signing docker images
• docker images
• docker manifests
• artifactory
• blobs
• homebrew tap formula
• gofish fish food cookbook
• scoop manifests
• discord
• reddit
• slack
• teams
• twitter
• smtp
• mattermost
• milestones
• snapshotting
• building snapshot... version=v2.0.2-next
• checking ./dist
• --rm-dist is set, cleaning it up
• loading go mod information
• writing effective config file
• writing config=dist\config.yaml
• building binaries
• building binary=C:\Users\arran_w\GolandProjects\triangle\dist\triangle_darwin_arm64\triangle
• building binary=C:\Users\arran_w\GolandProjects\triangle\dist\triangle_linux_arm_6\triangle
• building binary=C:\Users\arran_w\GolandProjects\triangle\dist\triangle_linux_arm_7\triangle
• building binary=C:\Users\arran_w\GolandProjects\triangle\dist\triangle_linux_amd64\triangle
• building binary=C:\Users\arran_w\GolandProjects\triangle\dist\triangle_windows_arm64\triangle.exe
• building binary=C:\Users\arran_w\GolandProjects\triangle\dist\triangle_windows_arm_6\triangle.exe
• building binary=C:\Users\arran_w\GolandProjects\triangle\dist\triangle_linux_arm64\triangle
• building binary=C:\Users\arran_w\GolandProjects\triangle\dist\triangle_darwin_amd64\triangle
• building binary=C:\Users\arran_w\GolandProjects\triangle\dist\triangle_windows_amd64\triangle.exe
• building binary=C:\Users\arran_w\GolandProjects\triangle\dist\triangle_windows_arm_7\triangle.exe
• build succeeded after 89.53s
$ ls
LICENSE README.md bench_test.go cmd delaunay.go dist doc.go go.mod go.sum imop.go output polygon.go process.go seed.go sobel.go stackblur.go utils vendor
$ ls -R dist
dist:
config.yaml triangle_darwin_arm64 triangle_linux_arm64 triangle_linux_arm_7 triangle_windows_arm64 triangle_windows_arm_7
triangle_darwin_amd64 triangle_linux_amd64 triangle_linux_arm_6 triangle_windows_amd64 triangle_windows_arm_6
dist/triangle_darwin_amd64:
triangle
dist/triangle_darwin_arm64:
triangle
dist/triangle_linux_amd64:
triangle
dist/triangle_linux_arm64:
triangle
dist/triangle_linux_arm_6:
triangle
dist/triangle_linux_arm_7:
triangle
dist/triangle_windows_amd64:
triangle.exe
dist/triangle_windows_arm64:
triangle.exe
dist/triangle_windows_arm_6:
triangle.exe
dist/triangle_windows_arm_7:
triangle.exe
Also deleted the Makefile as I broke it and this should replace it. However understandable if this should be added instead.
Reason I used build rather than release, is that release also pushes out to github and will expect a token to be provided. Github actions provide that token by default.
Using the --snapshot flag resolved the issue. I've checked the documentation and it seems that goreleaser require a matching tag prior publishing it.
I will play a little bit around and if I consider that it would be a better alternative over my custom script I will merge this PR.
Okay. I like how it produces RPMs and DEB files as it makes installation easy on my side. However I would rather have some sort of pipeline integrated with the deb system but not sure if that exists right now.