github.com/goreleaser/goreleaser@v1.25.1/www/docs/customization/blob.md (about) 1 # Blobs (s3, gcs, azblob) 2 3 The `blobs` allows you to upload artifacts to Amazon S3, Azure Blob and 4 Google GCS. 5 6 ## Customization 7 8 ```yaml 9 # .goreleaser.yaml 10 blobs: 11 # You can have multiple blob configs 12 - # Cloud provider name: 13 # - s3 for AWS S3 Storage 14 # - azblob for Azure Blob Storage 15 # - gs for Google Cloud Storage 16 # 17 # Templates: allowed 18 provider: azblob 19 20 # Set a custom endpoint, useful if you're using a minio backend or 21 # other s3-compatible backends. 22 # 23 # Implies s3ForcePathStyle and requires provider to be `s3` 24 # 25 # Templates: allowed 26 endpoint: https://minio.foo.bar 27 28 # Sets the bucket region. 29 # Requires provider to be `s3` 30 # 31 # Templates: allowed 32 region: us-west-1 33 34 # Disables SSL 35 # Requires provider to be `s3` 36 disable_ssl: true 37 38 # Bucket name. 39 # 40 # Templates: allowed 41 bucket: goreleaser-bucket 42 43 # IDs of the artifacts you want to upload. 44 ids: 45 - foo 46 - bar 47 48 # Path/name inside the bucket. 49 # 50 # Default: '{{ .ProjectName }}/{{ .Tag }}' 51 # Templates: allowed 52 directory: "foo/bar/{{.Version}}" 53 54 # Whether to disable this particular upload configuration. 55 # 56 # Since: v1.17 57 # Templates: allowed 58 disable: '{{ neq .BLOB_UPLOAD_ONLY "foo" }}' 59 60 # You can add extra pre-existing files to the bucket. 61 # The filename on the release will be the last part of the path (base). 62 # If another file with the same name exists, the last one found will be used. 63 # These globs can also include templates. 64 extra_files: 65 - glob: ./path/to/file.txt 66 - glob: ./glob/**/to/**/file/**/* 67 - glob: ./glob/foo/to/bar/file/foobar/override_from_previous 68 - glob: ./single_file.txt 69 # Templates: allowed 70 name_template: file.txt # note that this only works if glob matches 1 file only 71 72 # Additional templated extra files to uploaded. 73 # Those files will have their contents pass through the template engine, 74 # and its results will be uploaded. 75 # 76 # This feature is only available in GoReleaser Pro. 77 # Since: v1.17 (pro) 78 # Templates: allowed 79 templated_extra_files: 80 - src: LICENSE.tpl 81 dst: LICENSE.txt 82 83 # Allow to disable `s3ForcePathStyle`. 84 # 85 # Default: true 86 # Since: v1.24 87 s3_force_path_style: false 88 89 # ACL to be applied to all files in this configuration. 90 # 91 # If you need different ACLs for different files, create multiple `blobs` 92 # configurations. 93 # 94 # Only available when `provider` is S3. 95 # 96 # Default: empty 97 # Since: v1.24 98 acl: foo 99 100 # Cache control options. 101 # 102 # If you need different `cache_control` options for different files, 103 # create multiple `blobs` configurations. 104 # 105 # Default: empty 106 # Since: v1.24 107 cache_control: 108 - max-age=9999 109 - public 110 111 # Allows to set the content disposition of the file. 112 # 113 # If you need different `content_disposition` options for different files, 114 # create multiple `blobs` configurations. 115 # 116 # Since: v1.24 117 # Default: attachment;filename={{.Filename}} 118 # Templates: allowed 119 content_disposition: "inline" 120 121 - provider: gs 122 bucket: goreleaser-bucket 123 directory: "foo/bar/{{.Version}}" 124 - provider: s3 125 bucket: goreleaser-bucket 126 directory: "foo/bar/{{.Version}}" 127 ``` 128 129 !!! tip 130 131 Learn more about the [name template engine](/customization/templates/). 132 133 ## Authentication 134 135 GoReleaser's blob pipe authentication varies depending upon the blob provider as mentioned below: 136 137 ### S3 Provider 138 139 S3 provider support AWS 140 [default credential provider](https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials) 141 chain in the following order: 142 143 - Environment variables. 144 - Shared credentials file. 145 - If your application is running on an Amazon EC2 instance, IAM role for Amazon EC2. 146 147 ### Azure Blob Provider 148 149 ```yaml 150 blobs: 151 - provider: azblob 152 bucket: releases?storage_account=myazurestorage 153 ``` 154 155 Storage account is set over URL param `storage_account` in `bucket` or in environment variable `AZURE_STORAGE_ACCOUNT` 156 157 It supports authentication with 158 159 - [environment variables](https://docs.microsoft.com/en-us/azure/storage/common/storage-azure-cli#set-default-azure-storage-account-environment-variables): 160 - `AZURE_STORAGE_KEY` or `AZURE_STORAGE_SAS_TOKEN` 161 - [default Azure credential](https://learn.microsoft.com/en-us/azure/developer/go/azure-sdk-authentication-service-principal) 162 163 ### [GCS Provider](https://cloud.google.com/docs/authentication/production) 164 165 GCS provider uses 166 [Application Default Credentials](https://cloud.google.com/docs/authentication/production) 167 in the following order: 168 169 - Environment Variable (`GOOGLE_APPLICATION_CREDENTIALS`) 170 - Default Service Account from the compute instance (Compute Engine, 171 Kubernetes Engine, Cloud function etc). 172 173 ## ACLs 174 175 There is no common way to set ACLs across all bucket providers, so, [go-cloud][] 176 [does not support it yet][issue1108]. 177 178 You are expected to set the ACLs on the bucket/directory/etc, depending on your 179 provider. 180 181 [go-cloud]: https://gocloud.dev/howto/blob/ 182 [issue1108]: https://github.com/google/go-cloud/issues/1108