2021-10-30 09:50:23 -03:00
|
|
|
# Blobs (s3, gcs, azblob)
|
2019-06-05 15:51:01 +02:00
|
|
|
|
2020-05-11 09:35:58 -03:00
|
|
|
The `blobs` allows you to upload artifacts to Amazon S3, Azure Blob and
|
|
|
|
Google GCS.
|
|
|
|
|
2019-06-05 15:51:01 +02:00
|
|
|
## Customization
|
|
|
|
|
|
|
|
```yaml
|
2021-12-23 01:52:01 +01:00
|
|
|
# .goreleaser.yaml
|
2019-08-02 16:17:38 -03:00
|
|
|
blobs:
|
2019-06-05 15:51:01 +02:00
|
|
|
# You can have multiple blob configs
|
2023-07-06 16:51:23 +00:00
|
|
|
- # Cloud provider name:
|
2022-10-14 10:17:30 -03:00
|
|
|
# - s3 for AWS S3 Storage
|
|
|
|
# - azblob for Azure Blob Storage
|
|
|
|
# - gs for Google Cloud Storage
|
|
|
|
#
|
2024-06-19 11:44:22 -03:00
|
|
|
# Templates: allowed.
|
2019-06-05 15:51:01 +02:00
|
|
|
provider: azblob
|
2019-06-09 16:51:24 -03:00
|
|
|
|
2019-11-20 13:08:25 -03:00
|
|
|
# Set a custom endpoint, useful if you're using a minio backend or
|
|
|
|
# other s3-compatible backends.
|
2022-10-14 10:17:30 -03:00
|
|
|
#
|
2019-11-20 13:08:25 -03:00
|
|
|
# Implies s3ForcePathStyle and requires provider to be `s3`
|
2022-10-14 10:17:30 -03:00
|
|
|
#
|
2024-06-19 11:44:22 -03:00
|
|
|
# Templates: allowed.
|
2019-11-20 13:08:25 -03:00
|
|
|
endpoint: https://minio.foo.bar
|
|
|
|
|
2019-12-27 14:18:41 -03:00
|
|
|
# Sets the bucket region.
|
|
|
|
# Requires provider to be `s3`
|
2022-10-14 10:17:30 -03:00
|
|
|
#
|
2024-06-19 11:44:22 -03:00
|
|
|
# Templates: allowed.
|
2019-12-27 14:18:41 -03:00
|
|
|
region: us-west-1
|
|
|
|
|
|
|
|
# Disables SSL
|
|
|
|
# Requires provider to be `s3`
|
2024-01-07 14:34:48 -03:00
|
|
|
disable_ssl: true
|
2019-12-27 14:18:41 -03:00
|
|
|
|
2023-04-02 17:16:21 -03:00
|
|
|
# Bucket name.
|
2022-10-14 10:17:30 -03:00
|
|
|
#
|
2024-06-19 11:44:22 -03:00
|
|
|
# Templates: allowed.
|
2019-06-05 15:51:01 +02:00
|
|
|
bucket: goreleaser-bucket
|
2019-06-09 16:51:24 -03:00
|
|
|
|
|
|
|
# IDs of the artifacts you want to upload.
|
|
|
|
ids:
|
2023-07-06 16:51:23 +00:00
|
|
|
- foo
|
|
|
|
- bar
|
2019-06-09 16:51:24 -03:00
|
|
|
|
2023-04-02 17:16:21 -03:00
|
|
|
# Path/name inside the bucket.
|
|
|
|
#
|
2024-06-19 11:44:22 -03:00
|
|
|
# Default: '{{ .ProjectName }}/{{ .Tag }}'.
|
|
|
|
# Templates: allowed.
|
2024-04-01 10:01:56 -03:00
|
|
|
directory: "foo/bar/{{.Version}}"
|
2020-05-25 15:07:40 -03:00
|
|
|
|
2023-04-02 17:16:21 -03:00
|
|
|
# Whether to disable this particular upload configuration.
|
2023-03-23 08:59:04 -03:00
|
|
|
#
|
2024-06-19 11:44:22 -03:00
|
|
|
# Templates: allowed.
|
2024-07-12 09:46:10 -07:00
|
|
|
disable: '{{ ne .BLOB_UPLOAD_ONLY "foo" }}'
|
2023-03-23 08:59:04 -03:00
|
|
|
|
2021-11-22 14:53:08 -03:00
|
|
|
# You can add extra pre-existing files to the bucket.
|
2024-06-15 12:21:29 -03:00
|
|
|
#
|
2021-11-22 14:53:08 -03:00
|
|
|
# The filename on the release will be the last part of the path (base).
|
|
|
|
# If another file with the same name exists, the last one found will be used.
|
|
|
|
# These globs can also include templates.
|
2020-05-25 15:07:40 -03:00
|
|
|
extra_files:
|
|
|
|
- glob: ./path/to/file.txt
|
|
|
|
- glob: ./glob/**/to/**/file/**/*
|
|
|
|
- glob: ./glob/foo/to/bar/file/foobar/override_from_previous
|
2021-11-23 22:18:47 -03:00
|
|
|
- glob: ./single_file.txt
|
2024-06-19 11:44:22 -03:00
|
|
|
# Templates: allowed.
|
2021-11-23 22:18:47 -03:00
|
|
|
name_template: file.txt # note that this only works if glob matches 1 file only
|
2023-03-29 22:23:53 -03:00
|
|
|
|
|
|
|
# Additional templated extra files to uploaded.
|
|
|
|
# Those files will have their contents pass through the template engine,
|
|
|
|
# and its results will be uploaded.
|
|
|
|
#
|
2023-03-30 13:26:03 -03:00
|
|
|
# This feature is only available in GoReleaser Pro.
|
2024-06-19 11:44:22 -03:00
|
|
|
# Templates: allowed.
|
2023-03-29 22:23:53 -03:00
|
|
|
templated_extra_files:
|
|
|
|
- src: LICENSE.tpl
|
|
|
|
dst: LICENSE.txt
|
|
|
|
|
2024-01-07 15:22:57 -03:00
|
|
|
# Allow to disable `s3ForcePathStyle`.
|
2024-01-07 14:34:48 -03:00
|
|
|
#
|
2024-06-19 11:44:22 -03:00
|
|
|
# Default: true.
|
2024-01-07 14:34:48 -03:00
|
|
|
s3_force_path_style: false
|
|
|
|
|
2024-01-07 14:53:39 -03:00
|
|
|
# ACL to be applied to all files in this configuration.
|
2024-01-07 15:22:57 -03:00
|
|
|
#
|
2024-01-07 14:53:39 -03:00
|
|
|
# If you need different ACLs for different files, create multiple `blobs`
|
|
|
|
# configurations.
|
2024-01-07 15:22:57 -03:00
|
|
|
#
|
|
|
|
# Only available when `provider` is S3.
|
2024-01-07 14:53:39 -03:00
|
|
|
#
|
2024-06-19 11:44:22 -03:00
|
|
|
# Default: ''.
|
2024-01-07 14:53:39 -03:00
|
|
|
acl: foo
|
|
|
|
|
2024-01-07 15:03:07 -03:00
|
|
|
# Cache control options.
|
2024-01-07 15:22:57 -03:00
|
|
|
#
|
|
|
|
# If you need different `cache_control` options for different files,
|
2024-01-07 15:03:07 -03:00
|
|
|
# create multiple `blobs` configurations.
|
|
|
|
#
|
2024-06-19 11:44:22 -03:00
|
|
|
# Default: ''.
|
2024-01-07 15:03:07 -03:00
|
|
|
cache_control:
|
|
|
|
- max-age=9999
|
|
|
|
- public
|
|
|
|
|
2024-01-07 15:21:35 -03:00
|
|
|
# Allows to set the content disposition of the file.
|
|
|
|
#
|
2024-01-07 15:22:57 -03:00
|
|
|
# If you need different `content_disposition` options for different files,
|
|
|
|
# create multiple `blobs` configurations.
|
|
|
|
#
|
2024-06-19 11:44:22 -03:00
|
|
|
# Default: attachment;filename={{.Filename}}.
|
|
|
|
# Templates: allowed.
|
2024-05-10 03:13:46 +02:00
|
|
|
# Disable by setting the value to '-'
|
2024-01-07 15:21:35 -03:00
|
|
|
content_disposition: "inline"
|
|
|
|
|
2023-07-06 16:51:23 +00:00
|
|
|
- provider: gs
|
2019-06-05 15:51:01 +02:00
|
|
|
bucket: goreleaser-bucket
|
2024-04-01 10:01:56 -03:00
|
|
|
directory: "foo/bar/{{.Version}}"
|
2023-07-06 16:51:23 +00:00
|
|
|
- provider: s3
|
2019-06-05 15:51:01 +02:00
|
|
|
bucket: goreleaser-bucket
|
2024-04-01 10:01:56 -03:00
|
|
|
directory: "foo/bar/{{.Version}}"
|
2024-06-12 09:03:36 -03:00
|
|
|
|
|
|
|
|
|
|
|
# Upload metadata.json and artifacts.json to the release as well.
|
|
|
|
include_meta: true
|
|
|
|
|
|
|
|
# Upload only the files defined in extra_files.
|
|
|
|
extra_files_only: true
|
2019-06-05 15:51:01 +02:00
|
|
|
```
|
|
|
|
|
2024-07-17 10:56:36 -03:00
|
|
|
<!-- md:templates -->
|
2019-06-05 15:51:01 +02:00
|
|
|
|
|
|
|
## Authentication
|
|
|
|
|
2020-05-11 09:35:58 -03:00
|
|
|
GoReleaser's blob pipe authentication varies depending upon the blob provider as mentioned below:
|
2019-06-05 15:51:01 +02:00
|
|
|
|
2019-06-28 13:51:19 +02:00
|
|
|
### S3 Provider
|
2019-06-05 15:51:01 +02:00
|
|
|
|
2020-05-11 09:35:58 -03:00
|
|
|
S3 provider support AWS
|
|
|
|
[default credential provider](https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials)
|
|
|
|
chain in the following order:
|
2019-06-05 15:51:01 +02:00
|
|
|
|
2019-06-28 13:51:19 +02:00
|
|
|
- Environment variables.
|
|
|
|
- Shared credentials file.
|
2019-08-02 16:17:38 -03:00
|
|
|
- If your application is running on an Amazon EC2 instance, IAM role for Amazon EC2.
|
2019-06-28 13:51:19 +02:00
|
|
|
|
|
|
|
### Azure Blob Provider
|
|
|
|
|
2023-11-25 00:17:45 +01:00
|
|
|
```yaml
|
|
|
|
blobs:
|
|
|
|
- provider: azblob
|
|
|
|
bucket: releases?storage_account=myazurestorage
|
|
|
|
```
|
|
|
|
|
|
|
|
Storage account is set over URL param `storage_account` in `bucket` or in environment variable `AZURE_STORAGE_ACCOUNT`
|
2019-06-05 15:51:01 +02:00
|
|
|
|
2023-11-25 00:17:45 +01:00
|
|
|
It supports authentication with
|
2024-01-07 14:34:48 -03:00
|
|
|
|
2023-11-25 00:17:45 +01:00
|
|
|
- [environment variables](https://docs.microsoft.com/en-us/azure/storage/common/storage-azure-cli#set-default-azure-storage-account-environment-variables):
|
|
|
|
- `AZURE_STORAGE_KEY` or `AZURE_STORAGE_SAS_TOKEN`
|
|
|
|
- [default Azure credential](https://learn.microsoft.com/en-us/azure/developer/go/azure-sdk-authentication-service-principal)
|
2019-06-05 15:51:01 +02:00
|
|
|
|
|
|
|
### [GCS Provider](https://cloud.google.com/docs/authentication/production)
|
|
|
|
|
2020-05-11 09:35:58 -03:00
|
|
|
GCS provider uses
|
|
|
|
[Application Default Credentials](https://cloud.google.com/docs/authentication/production)
|
|
|
|
in the following order:
|
2019-06-28 13:51:19 +02:00
|
|
|
|
2020-05-11 09:35:58 -03:00
|
|
|
- Environment Variable (`GOOGLE_APPLICATION_CREDENTIALS`)
|
|
|
|
- Default Service Account from the compute instance (Compute Engine,
|
2023-07-06 16:51:23 +00:00
|
|
|
Kubernetes Engine, Cloud function etc).
|
2019-06-28 13:51:19 +02:00
|
|
|
|
2020-05-11 09:35:58 -03:00
|
|
|
## ACLs
|
2020-01-26 12:25:27 -03:00
|
|
|
|
|
|
|
There is no common way to set ACLs across all bucket providers, so, [go-cloud][]
|
|
|
|
[does not support it yet][issue1108].
|
|
|
|
|
2024-04-01 10:01:56 -03:00
|
|
|
You are expected to set the ACLs on the bucket/directory/etc, depending on your
|
2020-01-26 12:25:27 -03:00
|
|
|
provider.
|
|
|
|
|
|
|
|
[go-cloud]: https://gocloud.dev/howto/blob/
|
|
|
|
[issue1108]: https://github.com/google/go-cloud/issues/1108
|