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

feat: Use Version instead of Git tag to for .deb/.rpm #1157

Merged
merged 1 commit into from Oct 5, 2019

Conversation

PierreF
Copy link
Contributor

@PierreF PierreF commented Sep 27, 2019

This commit will allow to build package from a snapshot without have a package version of "0.0.0". Instead of using ctx.Git.CurrentTag, it will use ctx.Version. During a release both are the same value (with prefix "v" removed if it exists), so release pipeline stay unchanged.

With this changes, we can build package from snapshot which is useful in our use-case where we built package after each commit to master. We don't want to tag each commit but still want to build usable packages (e.g. with a version - coming from snapshot pipe) and not "0.0.0").
In addition, is allow us to build package with version that does not match SemVer (like 19.06.27.084010 which is the date + time converted to a version).

The package version i'm talking is the one set in package metadata, not just filename. That is the one visible for deb package using:

$ dpkg-deb -I dist/myproject_1.0.0_linux_386.deb
 new Debian package, version 2.0.
 size 13657068 bytes: control archive=450 bytes.
       1 octets,     0 lignes      conffiles            
     397 octets,    15 lignes      control              
      50 octets,     1 lignes      md5sums              
 Package: myproject
 Version: 0.0.0

@codecov-io
Copy link

Codecov Report

Merging #1157 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1157   +/-   ##
=======================================
  Coverage   82.98%   82.98%           
=======================================
  Files          58       58           
  Lines        3262     3262           
=======================================
  Hits         2707     2707           
  Misses        473      473           
  Partials       82       82
Impacted Files Coverage Δ
internal/pipe/nfpm/nfpm.go 92.48% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d1e97a3...f38d23d. Read the comment docs.

@caarlos0 caarlos0 changed the title Use Version instead of Git tag to for .deb/.rpm feat: Use Version instead of Git tag to for .deb/.rpm Sep 27, 2019
Copy link
Member

@caarlos0 caarlos0 left a comment

Choose a reason for hiding this comment

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

LGTM... lets see what other folks think :)

@caarlos0 caarlos0 merged commit e6c8682 into goreleaser:master Oct 5, 2019
@caarlos0
Copy link
Member

caarlos0 commented Oct 5, 2019

Thanks for the PR!

@github-actions
Copy link
Contributor

This pull request 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 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants