5 minute read

Release assets are the artifacts to be attached to releases upon publication. These may be local files (produced during the build process) or remote URLs. The configuration allows using dynamic templates so you can have multiple degrees of control over the released contents.

Release assets are configured within the releaseAssets section. The section allows one sub-section for each release asset.

Unless a release type defines a subset of release assets to publish by means of the assets option, all the release assets herein configured are published when the publish command runs.

Publication services may offer different support or have limitations for release assets. Please check the services page for details.

The outcome of the published artifacts is also summarized in the state releaseAssets attribute.

Release asset definition

Within the releaseAssets block you can define as many assets you need, each in its own separate block. The name identifies the asset configuration and is used solely for configuration purposes while it does not affect any artifacts characteristics.

Configuring release assets gives Nyx informations about:

  • whether the asset is a local file to be uploaded or is a remote URL to be attached as is to the published release
  • the asset name and description (or label)
  • the asset MIME type

Each release asset has the following attributes:

Name Type Command Line Option Environment Variable Default
releaseAssets/<NAME>/description string --release-assets-<NAME>-description=<TEMPLATE> NYX_RELEASE_ASSETS_<NAME>_DESCRIPTION=<TEMPLATE> N/A
releaseAssets/<NAME>/fileName string --release-assets-<NAME>-fileName=<TEMPLATE> NYX_RELEASE_ASSETS_<NAME>_FILE_NAME=<TEMPLATE> N/A
releaseAssets/<NAME>/path string --release-assets-<NAME>-path=<TEMPLATE> NYX_RELEASE_ASSETS_<NAME>_PATH=<TEMPLATE> N/A
releaseAssets/<NAME>/type string --release-assets-<NAME>-type=<TEMPLATE> NYX_RELEASE_ASSETS_<NAME>_TYPE=<TEMPLATE> N/A

When using multiple configuration methods or customizing presets, these values must be inherited or overridden as a whole. Overriding single values and inheriting others is not supported for this type of configuration option so when they are re-declared at one configuration level, all inherited values from those configuration methods with lower precedence are suppressed.

Name

Name releaseAssets/<NAME>
Type string
Default N/A
Command Line Option --release-assets-<NAME>=<NAME>
Environment Variable NYX_RELEASE_ASSETS_<NAME>=<NAME>
Configuration File Option releaseAssets/<NAME>
Related state attributes  

The name that identifies the asset within the configuration. This is actually not a field to be set within assets but instead the key of the map element.

This value never appears on published artifacts as it’s only used internally by Nyx.

This option is mandatory.

Description

Name releaseAssets/<NAME>/description
Type string
Default N/A
Command Line Option --release-assets-<NAME>-description=<TEMPLATE>
Environment Variable NYX_RELEASE_ASSETS_<NAME>_DESCRIPTION=<TEMPLATE>
Configuration File Option releaseAssets/items/<NAME>/description
Related state attributes description

This attribute gives the description (or label) for the artifact.

This is the user facing identifier for the artifact upon publication, when supported. The way this description appears in the generated release depends on the publication service and may even be ignored by some services.

Here you can pass a template to generate this attribute dynamically at runtime.

File name

Name releaseAssets/<NAME>/fileName
Type string
Default N/A
Command Line Option --release-assets-<NAME>-fileName=<TEMPLATE>
Environment Variable NYX_RELEASE_ASSETS_<NAME>_FILE_NAME=<TEMPLATE>
Configuration File Option releaseAssets/items/<NAME>/fileName
Related state attributes fileName

This attribute gives the name to the artifact file.

Although it’s suggested to make this name coherent with the path you are not required to.

This is the user facing file name for the artifact upon publication (i.e. the name of the file being downloaded), when supported. This name is used for the published artifacts only and doesn’t need to exist locally nor match the path. The way this name appears in the generated release depends on the publication service and may even be ignored by some services.

Here you can pass a template to generate this attribute dynamically at runtime (i.e. when the file name contains the version number).

Path

Name releaseAssets/<NAME>/path
Type string
Default N/A
Command Line Option --release-assets-<NAME>-path=<TEMPLATE>
Environment Variable NYX_RELEASE_ASSETS_<NAME>_PATH=<TEMPLATE>
Configuration File Option releaseAssets/items/<NAME>/path
Related state attributes path

This attribute defines the source path for the artifact, which may be a local file or a remote URL.

The way this attribute affects the artifacts in the generated release depends on the publication service but as a rule of thumb local files are uploaded and attached to the release while remote URLs are just listed as attachments and can be clicked to open the remote URL (also to download a file that was previously uploaded somewhere). Not all services support all types of paths.

When this is a local file the file doesn’t need to exist until the publish command runs so you can define an abstract file name here that will be generated during the build process. When the remote service supports custom file names this file name will not affect the name of the file that will be published and, in that case, the two fields don’t need to match.

Here you can pass a template to generate this attribute dynamically at runtime.

Type

Name releaseAssets/<NAME>/type
Type string
Default N/A
Command Line Option --release-assets-<NAME>-type=<TEMPLATE>
Environment Variable NYX_RELEASE_ASSETS_<NAME>_TYPE=<TEMPLATE>
Configuration File Option releaseAssets/items/<NAME>/type
Related state attributes type

This attribute defines the MIME type for the artifact.

The way this attribute affects the artifacts in the generated release depends on the publication service and may even be ignored. When in doubt just set this to application/octet-stream.

Here you can pass a template to generate this attribute dynamically at runtime.