1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-27 21:39:20 +02:00
bradenhilton ac40ce8a80
feat(chocolatey): allow template in copyright, provide ctx.ReleaseNotes (#4858)
<!--

Hi, thanks for contributing!

Please make sure you read our CONTRIBUTING guide.

Also, add tests and the respective documentation changes as well.

-->


<!-- If applied, this commit will... -->

This PR allows `chocolateys.copyright` to be templated, and provides
`ctx.ReleaseNotes` as `.Changelog`.

<!-- Why is this change being made? -->

Allowing templates for the copyright will enable, for example:

```yaml
chocolateys:
- ...
  copyright: Copyright (c) 1970-{{ .Now.Format "2006" }} Foo Bar
  ...
```

Without this change:

```xml
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
  <metadata>
    ...
    <copyright>Copyright (c) 1970-{{ .Now.Format &#34;2006&#34; }} Foo Bar</copyright>
    ...
  </metadata>
  ...
</package>
```

With this change:

```xml
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
  <metadata>
    ...
    <copyright>Copyright (c) 1970-2024 Foo Bar</copyright>
    ...
  </metadata>
  ...
</package>
```

---

Providing the release notes means they can be placed directly in the
package page instead of linking to them, for example:

```yaml
chocolateys:
- ...
  release_notes: '{{ .Changelog }}'
  ...
```

Without this change:

```console
❯ goreleaser release --skip=sign,announce,publish --clean
  • starting release...
  ...
  • chocolatey packages
    ⨯ release failed after 4s                  error=template: failed to apply "{{ .Changelog }}": template: failed to apply "{{ .Changelog }}": map has no entry for key "Changelog"
```

With this change:

```xml
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
  <metadata>
    ...
    <releaseNotes>## Changelog&#xA;### Other&#xA;* cfa5cbfa5 test&#xA;</releaseNotes>
    ...
  </metadata>
  ...
</package>
```

<!-- # Provide links to any relevant tickets, URLs or other resources
-->

---

These are already supported for WinGet.

There is probably a better way of doing this, and I've probably also
missed something, so feedback is welcome!
2024-06-11 09:29:55 -03:00
..
2024-06-05 08:44:41 -03:00
2024-06-04 22:09:10 -03:00
2024-06-04 10:13:11 -03:00
2024-04-27 00:37:39 -03:00
2022-12-19 23:51:17 -03:00
2024-02-20 22:27:42 -03:00
2023-07-20 13:16:30 +00:00
2024-06-11 02:37:45 +00:00
2024-05-25 14:09:49 -03:00
2020-05-10 17:32:55 -03:00
2024-06-05 08:41:45 -03:00
2023-06-13 12:38:31 +00:00
2023-12-26 11:29:46 -03:00
2024-06-11 09:22:39 -03:00
2023-10-10 12:39:32 +00:00
2023-06-21 17:48:38 -03:00
2024-06-03 22:08:50 -03:00