goreleaser / goreleaser

Deliver Go binaries as fast and easily as possible
https://goreleaser.com
MIT License
13.73k stars 939 forks source link

authors key from Chocolatey configuration doesn't seem to propagate to .nuspec file #5174

Open tstirrat15 opened 2 weeks ago

tstirrat15 commented 2 weeks ago

What happened?

See this PR: https://github.com/authzed/spicedb/pull/2087

And this failing workflow: https://github.com/authzed/spicedb/actions/runs/11184220476/job/31094502246?pr=2087

The error message is:

  • chocolatey packages
    • packing                                        nuspec=dist\spicedb.choco\spicedb.nuspec
  ⨯ release failed after 4m34s               error=failed to generate chocolatey package: exit status 1: Chocolatey v2.3.0
ERROR: CHCR0001: authors is a required element in the package nuspec file.

I'd expect the authors key here would get produced in the generated .nuspec file, unless there's something I'm missing about how the build process is supposed to work.

How can we reproduce this?

See links in previous section.

goreleaser version

Pro 2.3.2: https://github.com/authzed/spicedb/pull/2087/files#diff-374bd214cde16ea7ea23373ec846d6465445f3b8981702413ed4b01270cd1ad2R35-R48

GoReleaser Check

Search

Supporter

Code of Conduct

Additional context

No response

caarlos0 commented 2 weeks ago

per my testing, authors seems to be properly set in the nuspec:

builds:
  - env:
      - CGO_ENABLED=0
    goos:
      - windows
    goarch:
      - amd64

chocolateys:
  - use: archive
    authors: "someone"

then ran:

goreleaser release --snapshot --clean

and then looked into ./dist/*.choco/*.nuspec:

<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
  <metadata>
    <id>test</id>
    <version>1.2.12-beta-SNAPSHOT-b86bab8</version>
    <title>test</title>
    <authors>someone</authors>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description></description>
  </metadata>
  <files>
    <file src="tools\**" target="tools" />
  </files>
</package>

using goreleaser v2.3.2-pro.

caarlos0 commented 2 weeks ago

I also cloned spicedb, made the change on .goreleaser.windows.yml and ran it, and authors seem to be properly set 🤔

granted, I haven't tested on a windows machine yet, but the field definitely is in the nuspec file

tstirrat15 commented 2 weeks ago

Oh! Can I run this on a non-windows container? I'd made the implicit assumption that I needed a windows container. How did you install chocolatey on a non-windows box? The chocolatey docs seem to make the assumption that you're in a windows environment.

caffeine-addictt commented 2 weeks ago

How did you install chocolatey on a non-windows box

@tstirrat15 here's how I'm doing it in ubuntu-latest.

Don't forget to set the env

env:
  CHOCOLATEY_VERSION: 2.3.0 # https://github.com/chocolatey/choco/releases
caarlos0 commented 2 weeks ago

you don't need to install chocolatey to run it, it will fail because choco is not available, but at that point it would already be generated the nuspec file

caarlos0 commented 4 days ago

any new info on this? did you figure it out?

tstirrat15 commented 3 days ago

@caarlos0 it's gotten bumped down the priority list a bit - I'm hoping to get to it by the end of the week. Thank you for pointing me in the right direction!