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

Prerelease version using env #724

Closed
2 tasks done
cacack opened this issue Oct 9, 2023 · 2 comments · Fixed by #725
Closed
2 tasks done

Prerelease version using env #724

cacack opened this issue Oct 9, 2023 · 2 comments · Fixed by #725
Assignees
Labels
bug Something isn't working

Comments

@cacack
Copy link

cacack commented Oct 9, 2023

What happened?

Using env variables to set the package version with a pre-release specifier, nfpm doesn't create a valid version specifier for Alpine packages as documented here: https://wiki.alpinelinux.org/wiki/Package_policies.

Alpha, release candidates (_rc2), etc are prefixed with underscore _ not a hyphen.

I'd expect the package version to be 1.6.0_rc but instead it is 1.6.0rc

❯ PKG_VERSION="1.6.0-rc" nfpm package --packager apk --config nfpm.yaml --target ./  
using apk packager...
created package: test_1.6.0rc_x86_64.apk

❯ grep pkgver .PKGINFO 
pkgver = 1.6.0rc

How can we reproduce this?

touch dummy
❯ cat nfpm.yaml 
name: "test"
version: "${PKG_VERSION}"
contents:
  - src: ./dummy
    dst: /usr/local/bin/dummy
❯ PKG_VERSION="1.6.0-rc" nfpm package --packager apk --config nfpm.yaml --target ./  
using apk packager...
created package: test_1.6.0rc_x86_64.apk

nfpm version

❯ nfpm --version
       _____ ____  __  __
 _ __ |  ___|  _ \|  \/  |
| '_ \| |_  | |_) | |\/| |
| | | |  _| |  __/| |  | |
|_| |_|_|   |_|   |_|  |_|
nfpm: a simple and 0-dependencies deb, rpm, apk and arch linux packager written in Go
https://nfpm.goreleaser.com

GitVersion:    2.33.1
GitCommit:     bb6d0b9839c71ebd5d9d9bc0cf4088b3b933dc09
GitTreeState:  false
BuildDate:     2023-09-22T02:48:09Z
BuiltBy:       goreleaser
GoVersion:     go1.21.1
Compiler:      gc
ModuleSum:     h1:EkdAzZyVhAI9JC1vjmjjbmnNzyH1J6Cu4JCsA7YcQuc=
Platform:      darwin/arm64

Search

  • I did search for other open and closed issues before opening this.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Additional context

Version is being computed using svu.

Thanks for providing two awesome tools!

@cacack cacack added the bug Something isn't working label Oct 9, 2023
@cacack
Copy link
Author

cacack commented Oct 9, 2023

Ultimately I may not care as I'm using tr in other make recipes to adjust the semantic version to the package specific version. I haven't gotten to the point of consuming the APK from our repo to know if apk itself cares; I suspect it may throw off it's version graph but we rarely produce pre-release versions internally so 🤷 .

@caarlos0
Copy link
Member

can you check #725

thanks for the issue btw :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants