diff --git a/www/docs/customization/archive.md b/www/docs/customization/archive.md index bbbfb8a65..4a9ede4e5 100644 --- a/www/docs/customization/archive.md +++ b/www/docs/customization/archive.md @@ -121,9 +121,39 @@ archives: # File mode. mode: 0644 + + # Additional templated files to add to the archive. + # Those files will have their contents pass through the template engine, + # and its results will be added to the archive. + # + # Default: empty + # Since: v1.17 (pro) + # This feature is available in only GoReleaser Pro. + files: + # a more complete example, check the globbing deep dive below + - src: 'LICENSE.md.tpl' + dst: LICENSE.md + + # File info. + # Not all fields are supported by all formats available formats. + # Defaults to the file info of the actual file if not provided. + info: + # Templateable (since v1.14.0) + owner: root + + # Templateable (since v1.14.0) + group: root + + # Must be in time.RFC3339Nano format. + # Templateable (since v1.14.0) + mtime: '{{ .CommitDate }}' + + # File mode. + mode: 0644 + # Before and after hooks for each archive. # Skipped if archive format is binary. - # This feature is available in [GoReleaser Pro](/pro) only. + # This feature is available in only GoReleaser Pro. hooks: before: - make clean # simple string diff --git a/www/docs/customization/blob.md b/www/docs/customization/blob.md index 03a73d5ba..379c10c7e 100644 --- a/www/docs/customization/blob.md +++ b/www/docs/customization/blob.md @@ -70,6 +70,19 @@ blobs: - glob: ./glob/foo/to/bar/file/foobar/override_from_previous - glob: ./single_file.txt name_template: file.txt # note that this only works if glob matches 1 file only + + + # Additional templated extra files to uploaded. + # Those files will have their contents pass through the template engine, + # and its results will be uploaded. + # + # Default: empty + # Since: v1.17 (pro) + # This feature is available in only GoReleaser Pro. + templated_extra_files: + - src: LICENSE.tpl + dst: LICENSE.txt + - provider: gs bucket: goreleaser-bucket diff --git a/www/docs/customization/checksum.md b/www/docs/customization/checksum.md index d2945a1e8..adfabf059 100644 --- a/www/docs/customization/checksum.md +++ b/www/docs/customization/checksum.md @@ -41,6 +41,19 @@ checksum: - glob: ./glob/foo/to/bar/file/foobar/override_from_previous - glob: ./single_file.txt name_template: file.txt # note that this only works if glob matches 1 file only + + + # Additional templated extra files to add to the checksum. + # Those files will have their contents pass through the template engine, + # and its results will be added to the checksum. + # + # Default: empty + # Since: v1.17 (pro) + # This feature is available in only GoReleaser Pro. + templated_extra_files: + - src: LICENSE.tpl + dst: LICENSE.txt + ``` !!! tip diff --git a/www/docs/customization/docker.md b/www/docs/customization/docker.md index 02af3b813..7b81c093e 100644 --- a/www/docs/customization/docker.md +++ b/www/docs/customization/docker.md @@ -140,6 +140,21 @@ dockers: # and use wildcards when you `COPY`/`ADD` in your Dockerfile. extra_files: - config.yml + + + # Additional templated extra files to add to the Docker image. + # Those files will have their contents pass through the template engine, + # and its results will be added to the build context the same way as the + # extra_files field above. + # + # Default: empty + # Since: v1.17 (pro) + # This feature is available in only GoReleaser Pro. + templated_extra_files: + - src: LICENSE.tpl + dst: LICENSE.txt + mode: 0644 + ``` !!! warning diff --git a/www/docs/customization/nfpm.md b/www/docs/customization/nfpm.md index d35a62176..edd643b72 100644 --- a/www/docs/customization/nfpm.md +++ b/www/docs/customization/nfpm.md @@ -175,6 +175,19 @@ nfpms: - src: path/{{ .Os }}-{{ .Arch }}/bar.conf dst: /etc/foo/bar-{{ .ProjectName }}.conf + + # Additional templated contents to add to the archive. + # Those files will have their contents pass through the template engine, + # and its results will be added to the package. + # + # Default: empty + # Since: v1.17 (pro) + # This feature is available in only GoReleaser Pro. + files: + # a more complete example, check the globbing deep dive below + - src: 'LICENSE.md.tpl' + dst: LICENSE.md + # These files are not actually present in the package, but the file names # are added to the package header. From the RPM directives documentation: # diff --git a/www/docs/customization/publishers.md b/www/docs/customization/publishers.md index 99d5ce0d3..418b8e5d6 100644 --- a/www/docs/customization/publishers.md +++ b/www/docs/customization/publishers.md @@ -134,6 +134,19 @@ publishers: - glob: ./glob/foo/to/bar/file/foobar/override_from_previous - glob: ./single_file.txt name_template: file.txt # note that this only works if glob matches 1 file only + + + # Additional templated extra files to published. + # Those files will have their contents pass through the template engine, + # and its results will be published. + # + # Default: empty + # Since: v1.17 (pro) + # This feature is available in only GoReleaser Pro. + templated_extra_files: + - src: LICENSE.tpl + dst: LICENSE.txt + ``` These settings should allow you to push your artifacts to any number of diff --git a/www/docs/customization/release.md b/www/docs/customization/release.md index 76a39fa4e..f717e6893 100644 --- a/www/docs/customization/release.md +++ b/www/docs/customization/release.md @@ -120,6 +120,19 @@ release: - glob: ./glob/foo/to/bar/file/foobar/override_from_previous - glob: ./single_file.txt name_template: file.txt # note that this only works if glob matches 1 file only + + + # Additional templated extra files to add to the release. + # Those files will have their contents pass through the template engine, + # and its results will be added to the release. + # + # Default: empty + # Since: v1.17 (pro) + # This feature is available in only GoReleaser Pro. + templated_extra_files: + - src: LICENSE.tpl + dst: LICENSE.txt + ``` !!! tip diff --git a/www/docs/customization/snapcraft.md b/www/docs/customization/snapcraft.md index f2499e19f..9b08258e9 100644 --- a/www/docs/customization/snapcraft.md +++ b/www/docs/customization/snapcraft.md @@ -104,6 +104,18 @@ snapcrafts: destination: bin/drumroll.wrapper mode: 0755 + # Additional templated extra files to add to the package. + # Those files will have their contents pass through the template engine, + # and its results will be added to the package. + # + # Default: empty + # Since: v1.17 (pro) + # This feature is available in only GoReleaser Pro. + templated_extra_files: + - source: LICENSE.tpl + destination: LICENSE.txt + mode: 0644 + # With layouts, you can make elements in $SNAP, $SNAP_DATA, $SNAP_COMMON # accessible from locations such as /usr, /var and /etc. This helps when # using pre-compiled binaries and libraries that expect to find files and diff --git a/www/docs/customization/source.md b/www/docs/customization/source.md index 2a393d56c..02ea68e06 100644 --- a/www/docs/customization/source.md +++ b/www/docs/customization/source.md @@ -61,6 +61,25 @@ source: mode: 0644 # format is `time.RFC3339Nano` mtime: 2008-01-02T15:04:05Z + + + # Additional templated files to add to the source archive. + # Those files will have their contents pass through the template engine, + # and its results will be added to the source archive. + # + # Default: empty + # Since: v1.17 (pro) + # This feature is available in only GoReleaser Pro. + files: + # a more complete example, check the globbing deep dive below + - src: 'LICENSE.md.tpl' + dst: LICENSE.md + info: + owner: root + group: root + mode: 0644 + mtime: 2008-01-02T15:04:05Z + ``` !!! tip diff --git a/www/docs/pro.md b/www/docs/pro.md index 966c116f0..636d2e072 100644 --- a/www/docs/pro.md +++ b/www/docs/pro.md @@ -4,14 +4,15 @@ GoReleaser Pro is a paid, closed-source GoReleaser distribution with some additional features: -- [x] [Template entire files](/customization/templatefiles) and add the to the - release; +- [x] [Template entire files](/customization/templatefiles) and add them to the + release. You can also template files that will be included in archives, + packages, Docker images, etc...; - [x] Use the [`.Artifacts`](/customization/templates/#artifacts) template variable to build more powerful customizations; - [x] [Split and merge builds](/customization/partial) to speed up your release by splitting work, use CGO, or run platform-specific code; - [x] More [changelog options](/customization/changelog): Filter commits by path - & sub-groups, group dividers; + & subgroups, group dividers; - [x] Have custom [before and after hooks for archives](/customization/archive/); - [x] Prepare a release with [`goreleaser release --prepare`](/cmd/goreleaser_release/), publish and diff --git a/www/docs/static/schema-pro.json b/www/docs/static/schema-pro.json index 7ed1f1a61..3186e34ae 100644 --- a/www/docs/static/schema-pro.json +++ b/www/docs/static/schema-pro.json @@ -231,6 +231,12 @@ }, "hooks": { "$ref": "#/$defs/ArchiveHooks" + }, + "templated_files": { + "items": { + "$ref": "#/$defs/TemplatedFile" + }, + "type": "array" } }, "additionalProperties": false, @@ -301,6 +307,12 @@ "type": "boolean" } ] + }, + "templated_extra_files": { + "items": { + "$ref": "#/$defs/TemplatedExtraFile" + }, + "type": "array" } }, "additionalProperties": false, @@ -601,6 +613,12 @@ "$ref": "#/$defs/ExtraFile" }, "type": "array" + }, + "templated_extra_files": { + "items": { + "$ref": "#/$defs/TemplatedExtraFile" + }, + "type": "array" } }, "additionalProperties": false, @@ -873,6 +891,12 @@ }, "use": { "type": "string" + }, + "templated_files": { + "items": { + "$ref": "#/$defs/TemplatedExtraFileWithMode" + }, + "type": "array" } }, "additionalProperties": false, @@ -1712,6 +1736,9 @@ "archlinux": { "$ref": "#/$defs/NFPMArchLinux" }, + "templated_contents": { + "$ref": "#/$defs/Contents" + }, "overrides": { "patternProperties": { ".*": { @@ -2006,6 +2033,9 @@ }, "archlinux": { "$ref": "#/$defs/NFPMArchLinux" + }, + "templated_contents": { + "$ref": "#/$defs/Contents" } }, "additionalProperties": false, @@ -2381,6 +2411,12 @@ "$ref": "#/$defs/ExtraFile" }, "type": "array" + }, + "templated_extra_files": { + "items": { + "$ref": "#/$defs/TemplatedExtraFile" + }, + "type": "array" } }, "additionalProperties": false, @@ -2486,6 +2522,12 @@ "replace" ], "default": "keep-existing" + }, + "templated_extra_files": { + "items": { + "$ref": "#/$defs/TemplatedExtraFile" + }, + "type": "array" } }, "additionalProperties": false, @@ -2866,6 +2908,12 @@ "$ref": "#/$defs/SnapcraftExtraFiles" }, "type": "array" + }, + "templated_extra_files": { + "items": { + "$ref": "#/$defs/SnapcraftExtraFiles" + }, + "type": "array" } }, "additionalProperties": false, @@ -3061,6 +3109,12 @@ }, "rlcp": { "type": "boolean" + }, + "templated_files": { + "items": { + "$ref": "#/$defs/TemplatedFile" + }, + "type": "array" } }, "additionalProperties": false, @@ -3144,6 +3198,48 @@ "dst" ] }, + "TemplatedExtraFile": { + "properties": { + "src": { + "type": "string" + }, + "dst": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "TemplatedExtraFileWithMode": { + "properties": { + "src": { + "type": "string" + }, + "dst": { + "type": "string" + }, + "mode": { + "type": "integer" + } + }, + "additionalProperties": false, + "type": "object" + }, + "TemplatedFile": { + "properties": { + "src": { + "type": "string" + }, + "dst": { + "type": "string" + }, + "info": { + "$ref": "#/$defs/FileInfo" + } + }, + "additionalProperties": false, + "type": "object" + }, "Twitter": { "properties": { "enabled": {