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 github action #26

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

goreleaser github action #26

wants to merge 3 commits into from

Conversation

arran4
Copy link

@arran4 arran4 commented Apr 23, 2022

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

@esimov
Copy link
Owner

esimov commented Apr 25, 2022

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

@arran4
Copy link
Author

arran4 commented Apr 25, 2022

Where are you seeing that? When you try build it locally?

@arran4
Copy link
Author

arran4 commented Apr 25, 2022

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.

@esimov
Copy link
Owner

esimov commented Apr 25, 2022

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

@arran4
Copy link
Author

arran4 commented Apr 25, 2022

$ 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.

@arran4
Copy link
Author

arran4 commented Apr 25, 2022

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.

@esimov
Copy link
Owner

esimov commented Apr 25, 2022

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.

@arran4
Copy link
Author

arran4 commented Feb 24, 2023

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.

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.

None yet

2 participants