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

Error when releasing a tag #1206

Closed
bodgit opened this issue Oct 19, 2019 · 6 comments
Closed

Error when releasing a tag #1206

bodgit opened this issue Oct 19, 2019 · 6 comments
Labels
bug Something isn't working

Comments

@bodgit
Copy link

bodgit commented Oct 19, 2019

Describe the bug

I'm trying to set up GoReleaser with Github actions. It seems to build commits fine, but when I push a tag that should be published, it errors with git is currently in a dirty state, please check in your pipeline what can be changing the following files, and then doesn't print any files. I've run go mod tidy locally and it's not producing any changes.

To Reproduce

Here's my goreleaser.yml:

---
before:
  hooks:
    - go mod tidy
builds:
  - main: ./cmd/torrent/main.go
    env:
      - CGO_ENABLED=0
    goarch:
      - amd64
      - arm
    goos:
      - darwin
      - linux
      - windows
      - freebsd
      - openbsd
      - solaris
checksum:
  name_template: 'checksums.txt'
release:
  prerelease: auto

Expected behavior

I was expecting to get some releases built and published.

Environment (please complete the following information):

  • OS: Ubuntu (whatever is running Github Actions)
  • GoReleaser Version 0.120.0

Additional context

Here's what I get in the logs:

Run goreleaser/goreleaser-action@v1
  with:
    version: latest
    args: release
  env:
    GOROOT: /opt/hostedtoolcache/go/1.13.3/x64
    GITHUB_TOKEN: ***
✅ GoReleaser version found: v0.120.0
⬇️ Downloading https://github.com/goreleaser/goreleaser/releases/download/v0.120.0/goreleaser_Linux_x86_64.tar.gz...
📦 Extracting GoReleaser...
/bin/tar xz -C /home/runner/work/_temp/dcce10ee-f711-4d9e-b0ff-4d795f0c1f8e -f /tmp/goreleaser-TO2Hcm/goreleaser_Linux_x86_64.tar.gz
✅ v1.0.0 tag found
🏃 Running GoReleaser...
/home/runner/work/_temp/dcce10ee-f711-4d9e-b0ff-4d795f0c1f8e/goreleaser release

   • releasing using goreleaser 0.120.0...
   • loading config file       file=.goreleaser.yml
   • RUNNING BEFORE HOOKS     
      • running go mod tidy      
   • LOADING ENVIRONMENT VARIABLES
   • GETTING AND VALIDATING GIT STATE
      • releasing v1.0.0, commit a838c78fcd1e006745a2c30d7f33b60d62c6c127
   ⨯ release failed after 0.19s error=git is currently in a dirty state, please check in your pipeline what can be changing the following files:

##[error]The process '/home/runner/work/_temp/dcce10ee-f711-4d9e-b0ff-4d795f0c1f8e/goreleaser' failed with exit code 1
##[error]Node run failed with exit code 1

The repo is https://github.com/bodgit/torrent if that helps.

@bodgit bodgit added the bug Something isn't working label Oct 19, 2019
@caarlos0
Copy link
Member

⨯ release failed after 0.19s error=git is currently in a dirty state, please check in your pipeline what can be changing the following files:

Probably go mod tidy is changing the go.sum file.

try running it locally and commit the changes as well..

@bodgit
Copy link
Author

bodgit commented Oct 19, 2019

I've tried that, it doesn't update go.sum, it also only happens on the tag builds, not normal pushes, surely it would fail every time if go.sum was somehow not current?

@caarlos0
Copy link
Member

not really, normal builds are run with --snapshots, which skips those validations...

@bodgit
Copy link
Author

bodgit commented Oct 20, 2019

Thanks for #1178, it immediately highlighted that it was complaining about the built binary which I hadn't excluded with .gitignore. Once I did that it everything is now happy.

@bodgit bodgit closed this as completed Oct 20, 2019
@caarlos0
Copy link
Member

awesome, thanks for reporting this! 🚀

@github-actions
Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants