1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-06 03:13:48 +02:00
Commit Graph

745 Commits

Author SHA1 Message Date
Carlos A Becker
7242733140
test: fix nfpm tests
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-11-29 21:59:38 -03:00
Carlos A Becker
6ff89366ca
fix: improve nfpm error
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-11-29 08:13:53 -03:00
Carlos A Becker
7ab711d682
test: fixed some tests
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-11-28 22:42:29 -03:00
Carlos Alexandro Becker
c2adc1727f
fix: missing digests on manifests (#3602)
it was missing the digest parsing for the manifest, and there were no
tests covering it.

now the tests are there, and so is the fix.

refs #3599
2022-11-28 21:30:16 -03:00
Carlos A Becker
f05f3b5b7f
fix: merge issues 2022-11-28 14:28:38 -03:00
Carlos Alexandro Becker
1b8395d6b6
feat(build): allow to template env (#3592)
GoReleaser evolved a lot since the last time I tried to implement this
>1 year ago.
Now its 100% possible, and way simpler to do it!

closes #3580
refs #2583

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-11-25 15:26:29 -03:00
Carlos Alexandro Becker
e54656438b
feat: deprecate replacements (#3589)
The replacements thing was always a bit weird, especially on archives.

We can solve that with templates, so, removing I'm deprecating it.

Also did the same on other places that had it the same feature.

Closes #3588

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-11-25 15:26:14 -03:00
Carlos Alexandro Becker
541e3dfed9
feat(brew): allow to template brew.install (#3593) 2022-11-25 09:32:43 -03:00
John Olheiser
b66568529d
feat: add windows to default builds (#3581)
Resolves #3579

Signed-off-by: jolheiser <john.olheiser@gmail.com>
2022-11-24 15:48:37 -03:00
Carlos Alexandro Becker
ab08d0b706
fix: move mastodon server to yaml (#3568)
refs #3567

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-11-17 20:54:57 -03:00
John Olheiser
e65c53172e
feat: add mastodon (#3567)
This PR adds [mastodon](https://joinmastodon.org/) as an announcement
pipeline. 🥳


![mastodon-announce](https://user-images.githubusercontent.com/42128690/202544345-d90d8f10-0818-4bc2-bc35-3dbcba4254b0.png)


Resolves #3566

Signed-off-by: jolheiser <john.olheiser@gmail.com>
2022-11-17 20:40:00 -03:00
Carlos A Becker
8ef1d4339b
test: fix docker test
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-11-17 20:39:21 -03:00
Carlos A Becker
1a9209eb1f
fix: log missing image name
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-11-15 08:59:18 -03:00
Carlos A Becker
096c6ba6b2
fix: variable name 2022-11-15 08:31:21 -03:00
Carlos A Becker
33ea55b8e6
refactor: use the variable from artifact
refs #3496

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-11-15 08:29:01 -03:00
Carlos Alexandro Becker
4863781b48
feat: use digest on manifests (#3555)
this use the digests on the manifest creation.
Another PR will add it to signing too.

refs #3496
refs #3540

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-11-15 08:21:28 -03:00
Carlos Alexandro Becker
b55b9976c7
feat: use digest to sign docker images/manifests (#3556)
this drives it home by using the actual images/manifest digests to sign
with cosign by default.

the default signing command is changing in this PR, but since `digest`
should be always there (if not, the pipeline will fail way earlier), it
should be fine.

refs https://github.com/goreleaser/goreleaser/issues/3496
refs https://github.com/goreleaser/goreleaser/pull/3540

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-11-15 08:21:18 -03:00
Carlos Alexandro Becker
5ca4a7d2ff
fix: log when no artifacts are found for docker (#3554)
refs #3545

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-11-14 14:49:49 -03:00
gal-legit
76dc0b559e
feat: output checksums to artifacts info (#3548)
Following #3540, output artifacts' checksums to the artifact info.
This addition makes it easier to consume the checksums, especially when
running from e.g. GitHub Actions.

New tests:
1. Add a check for the checksum in the extra field. 
2. Add a test for every checksum algorithm (to see that it doesn't break
for any algo's output).
3. Add a case of a binary and an extra file (to see that the logic
doesn't break when there's a mix).

p.s.
While working on that, I noticed that the convention for extra fields is
actually to use UpperCamelCase rather than lower.
I was mistaken because I looked at the subfields of the "DockerConfig"
extra field.
I think it's a good idea to fix it quickly, before the next release
rolls and it becomes a compatibility issue.
I took the liberty to fix it here as an extra commit. Please let me know
if you want it to be in a separate PR.

---
Tests:
```
go test
  • refreshing checksums                             file=binary_bar_checksums.txt
  • refreshing checksums                             file=binary_bar_checksums.txt
  • refreshing checksums                             file=binary_bar_checksums.txt
PASS
ok  	github.com/goreleaser/goreleaser/internal/pipe/checksums	0.184s
```

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2022-11-14 14:49:34 -03:00
Carlos A Becker
6df90e578a
test: fix defaults test 2022-11-14 14:00:12 -03:00
Carlos Alexandro Becker
bb00edac2a
fix: set dockers.goarm to 6 by default (#3552)
fixes #3545

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-11-14 13:59:01 -03:00
Carlos A Becker
e1ab1049ed
test: fix broken test
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-11-12 17:57:02 -03:00
Carlos A Becker
e8c0f578b5
test: improve test stability
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-11-12 15:44:26 -03:00
gal-legit
5eb1e4ad0d
feat: add digest to artifacts info of published docker images (#3540)
Extract the digest (sha256) of docker images from the `docker push`
command for dockers published to the docker registry.
Outputting the digest is required to avoid a race condition when
referencing the image, where the image tag is being modified before the
reference is done.
See this [blog
post](https://github.com/goreleaser/goreleaser/issues/3496) for more
info.
This PR fixes https://github.com/goreleaser/goreleaser/issues/3496.

Note that the 'publish' pipe now must run before the 'metadata' pipe, so
that the information extracted during the 'publish' pipe would appear in
the metadata.
Previously, the published docker images metadata wasn't printed (because
of the order). It made sense because the content of the published image
was just a subset of the local one.
Now that it is printed to the metadata, it should have a different name
to avoid confusion.
As I mentioned, it wasn't printed before - so there shouldn't be any
backward-compatibility issues.

---
Local tests:
```
go test -v .
=== RUN   TestVersion
=== RUN   TestVersion/only_version
=== RUN   TestVersion/version_and_date
=== RUN   TestVersion/version,_date,_built_by
=== RUN   TestVersion/all_empty
=== RUN   TestVersion/complete
--- PASS: TestVersion (0.00s)
    --- PASS: TestVersion/only_version (0.00s)
    --- PASS: TestVersion/version_and_date (0.00s)
    --- PASS: TestVersion/version,_date,_built_by (0.00s)
    --- PASS: TestVersion/all_empty (0.00s)
    --- PASS: TestVersion/complete (0.00s)
PASS
ok      github.com/goreleaser/goreleaser        0.764s
```

Output example:
```
  {
    "name": "gallegit/hello-world:latest",
    "path": "gallegit/hello-world:latest",
    "goos": "linux",
    "goarch": "amd64",
    "internal_type": 10,
    "type": "Published Docker Image",
    "extra": {
      "digest": "sha256:c3f7dd196a046dc061236d3c6ae1e2946269e90da30b0a959240ca799750e632"
    }
  }
```

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2022-11-12 14:51:53 -03:00
Carlos Alexandro Becker
778f099a9a
fix: improve artifactory error handling (#3546)
closes #3543

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-11-12 00:49:08 -03:00
Fabio Ribeiro
f2281e8ff2
feat: chocolatey support (#3509)
This PR adds support for generating the structure used to pack and push
Chocolatey Packages. And will solve the #3154

Is not ready for merge yet, but has the main structure, and ready for
comments.

Accordingly to Chocolatey, in order to build a package, it's necessary a
`.nuspec` and `chocolateyinstall.ps1` files at least, having these ones,
we could pack and distribute without adding the binary inside the final
package and that was implemented here.

To complete, will be necessary to define the package build and
distribute, however will be required to have Chocolatey installed
(Windows Only). One of alternatives that I thought was, publish the
files like Scoop and Brew in a separate repository, and there we could
use `chocolatey` through
[crazy-max/ghaction-chocolatey](https://github.com/crazy-max/ghaction-chocolatey).

Chocolatey has a lot of good examples of repositories:

https://github.com/chocolatey-community/chocolatey-packages/tree/master/automatic/curl

A final compilation of the missing parts:
- [x] How to pack and push (chocolatey)
- [x] Documentation

Sorry for the long description😄 

All feedback very welcome!

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2022-11-11 23:52:32 -03:00
Carlos A Becker
22a7a9a835
refactor: small improvements
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-11-11 23:42:52 -03:00
Giorgio Azzinnaro
0a536f08fd
feat: build of shared/static libraries (#3511)
<!--

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 improves the handling of shared or static libraries by
GoReleaser. It uses the default behaviour of the Go compiler by
appending the right extension to libraries.

* `.so` and `.a` for Linux shared libraries and static libraries
respectively
* `.dylib` and `.a.` on Darwin
* `.dll` and `.lib` on Windows (pre-existent)

It does not add any configuration option to `.goreleaser.yml`, since it
leverages the existing `buildmode` flag.

Additionally, this PR takes care of adding the generated header file
into the archive.

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

Personally I would leverage this change to release some software both as
a CLI and as a shared library. I believe others who use CGo or need
interoperability with Go from other languages could benefit from this.

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

This was previously discussed in #3497.

I couldn't quite think of a proper way to add some tests to the header
archiving feature. Any recommendation?
2022-11-11 23:35:51 -03:00
Steven Hartland
0ea4f1d5b7
fix(changelog): group regexps (#3527)
Fix the regular expressions used in changelog group processing to valid
golang (RE2) regexps. These previously used PCRE character class `\w`
which is not supported in RE2 which is what golang regexp uses.

Also document that format matches not just title as some may thing but
the format `<abbrev-commit> <title-commit>`.
2022-11-07 09:28:52 -03:00
Carlos A Becker
129c23f2d9
test: fix scm test on forks
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-11-04 16:02:33 -03:00
Carlos A Becker
4f2c0ce34a
test: skip sbom tests locally if not syft
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-11-04 16:00:29 -03:00
Arsen6331
ad359a4712
feat: implement nfpm archlinux packages (#3470)
<!--

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 implements the Archlinux packages that were added in nfpm
v2.20.0, as well as tests and documentation for them.

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

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

goreleaser/nfpm#133
goreleaser/nfpm#543
Fixes #3469

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2022-11-02 15:30:06 -03:00
Carlos Alexandro Becker
1a69d44d6d
fix: allow to template scoop/brew/krew repo ref (#3521)
closes #3508

- adds template support for krew and scoop repo refs
- template branch on reporef on brew as well

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-11-02 14:54:16 -03:00
Carlos A Becker
f2f72a57e3
test: gitea with trailing slash 2022-10-21 22:53:24 -03:00
Sam Therapy
154c520755
fix: Trim trailing slash from Gitea URL (#3488)
This PR will truncate any trailing slash left by specifying only a Gitea
API URL.

Fixes #3487

I have not added any tests for this.

Signed-off-by: Sam Therapy <sam@samtherapy.net>
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2022-10-21 22:42:19 -03:00
Carlos A Becker
f90df0f5ec
fix: getting previous tag
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-10-17 22:39:32 -03:00
Carlos Alexandro Becker
27cbbd8e66
fix: change publishers order a bit (#3473)
closes https://github.com/goreleaser/goreleaser/discussions/3472
2022-10-17 21:19:11 -03:00
Arsen6331
f6eb51cb9c
feat: integrate ConventionalExtension from nfpm v2.20.0 (#3468)
<!--

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 upgrades nFPM to v0.20.0, and integrates the new
`ConventionalExtension` method to use the correct extension for the
packaging format that is being used.

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

Currently, goreleaser uses the name of the format to determine the
extension. This has worked fine, but with the introduction of Archlinux
packages, goreleaser has to handle packages with extensions that don't
match the name of the format, since Archlinux uses `.pkg.tar.zst` as the
extension.

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

goreleaser/nfpm#546
goreleaser/nfpm#543
2022-10-15 16:57:39 -03:00
Carlos Alexandro Becker
9e6fb4f55c
feat: more templateable fields for blobs (#3461)
closes #3460

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-10-14 10:17:30 -03:00
Carlos Alexandro Becker
2b0bdffb3e
refactor: making it easier to merge with pro (#3463)
this improves mergeability between pro and oss a bit

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-10-14 00:31:05 -03:00
Carlos Alexandro Becker
080ccff8db
feat: nfpm for ios (#3436)
Jailbroken iOS can install deb packages, and it seems the only change
needed is to set the OS to `ios` instead of `linux`.

Closes #3410

cc/ @blacktop

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-10-12 21:24:39 -03:00
Carlos A Becker
d88600aca7
fix: revert unwanted change in docker.go
refs #3414
2022-10-05 11:12:50 -03:00
Carlos Alexandro Becker
a42c8ae706
feat: aur backup (#3366)
closes #3353
2022-10-05 09:42:17 -03:00
Carlos Alexandro Becker
24178b1060
feat: permanently remove buildpacks (#3414)
removing for good!

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-10-05 09:42:05 -03:00
NoahK
81de8addf1
feat: MarkdownV2 for Telegram announcer (#3435)
Set MarkdownV2 as parse mode for Telegram announcer.

This allows for additional formatting in the announcement, such as
`code` or _italic_ sections. For details, see the official [Telegram Bot
API](https://core.telegram.org/bots/api#markdownv2-style).

If someone has the time (not added in this PR), I think it would be
great to add a field to the Telegram config for the parse mode. This
would allow setting a different parse mode than MarkdownV2, such as
HTML.

This fixes #3431.
2022-10-05 09:35:01 -03:00
Carlos Alexandro Becker
4a51099964
fix: gomod.env not being used (#3434)
Fixes  #3426

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-10-04 13:01:18 -03:00
Carlos Alexandro Becker
d7cf3dd889
docs: update nfpm docs (#3396)
closes #3380

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-09-24 22:42:30 -03:00
Carlos A Becker
e9a54ce40b
test: fixed a broken test
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-09-18 14:21:33 -03:00
Carlos A Becker
91c6f75b8f
chore: ign linter warning
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-09-17 00:14:59 -03:00
Carlos Alexandro Becker
c1965923b0
docs: improve wording/formatting in several places (#3384)
this just improves docs wording and formatting in several places.

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-09-17 00:13:09 -03:00