From ca5ad8c5ed0aea8624f574d94e86695e8573ce81 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Sat, 26 Oct 2024 14:06:55 -0300 Subject: [PATCH] docs: update Signed-off-by: Carlos Alexandro Becker --- www/docs/customization/dmg.md | 17 +++++++++++++++++ www/docs/customization/upload.md | 4 +++- www/docs/static/schema-pro.json | 31 +++++++++++++++++++++++-------- 3 files changed, 43 insertions(+), 9 deletions(-) diff --git a/www/docs/customization/dmg.md b/www/docs/customization/dmg.md index 1d088281d..5520f1e20 100644 --- a/www/docs/customization/dmg.md +++ b/www/docs/customization/dmg.md @@ -44,6 +44,23 @@ dmg: # will be built. extra_files: - logo.ico + - glob: ./docs/*.md + - glob: ./single_file.txt + # Templates: allowed. + # Note that this only works if glob matches exactly 1 file. + name_template: file.txt + + # Additional templated extra files to add to the DMG. + # Those files will have their contents pass through the template engine, + # and its results will be added to the image as it would with the + # extra_files field above. + # + # Since: v2.4 (pro). + # Templates: allowed. + templated_extra_files: + - src: LICENSE.tpl + dst: LICENSE.txt + mode: 0644 # Whether to remove the archives from the artifact list. # If left as false, your end release will have both the archives and the diff --git a/www/docs/customization/upload.md b/www/docs/customization/upload.md index f1ea4dcc3..e5e331243 100644 --- a/www/docs/customization/upload.md +++ b/www/docs/customization/upload.md @@ -241,11 +241,13 @@ uploads: # Since: v2.1. extra_files: - glob: ./path/to/file.txt + - glob: ./docs/*.md - glob: ./glob/**/to/**/file/**/* - glob: ./glob/foo/to/bar/file/foobar/override_from_previous - glob: ./single_file.txt # Templates: allowed. - name_template: file.txt # note that this only works if glob matches 1 file only + # Note that this only works if glob matches exactly 1 file. + name_template: file.txt # Additional templated extra files to uploaded. # Those files will have their contents pass through the template engine, diff --git a/www/docs/static/schema-pro.json b/www/docs/static/schema-pro.json index a5d1bb0bf..9263b03c2 100644 --- a/www/docs/static/schema-pro.json +++ b/www/docs/static/schema-pro.json @@ -1043,7 +1043,7 @@ }, "extra_files": { "items": { - "type": "string" + "$ref": "#/$defs/ExtraFile" }, "type": "array" }, @@ -1062,6 +1062,12 @@ "enum=binary", "appbundle" ] + }, + "templated_extra_files": { + "items": { + "$ref": "#/$defs/TemplatedExtraFile" + }, + "type": "array" } }, "additionalProperties": false, @@ -1276,16 +1282,25 @@ "type": "object" }, "ExtraFile": { - "properties": { - "glob": { + "oneOf": [ + { "type": "string" }, - "name_template": { - "type": "string" + { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/goreleaser/goreleaser/v2/pkg/config/file-alias", + "properties": { + "glob": { + "type": "string" + }, + "name_template": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" } - }, - "additionalProperties": false, - "type": "object" + ] }, "File": { "oneOf": [