-
Notifications
You must be signed in to change notification settings - Fork 27
/
.goreleaser.yaml
105 lines (96 loc) · 3.47 KB
/
.goreleaser.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
project_name: apm-lambda-extension
before:
hooks:
- make check-licenses
- make NOTICE.txt
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
- arm64
flags:
- -trimpath
ldflags:
- -s -w
binary: "extensions/{{ .ProjectName }}"
mod_timestamp: '{{ .CommitTimestamp }}'
archives:
- id: zip
format: zip
name_template: |-
{{ .Tag }}-{{ .Os }}-{{ .Arch }}
files:
- src: NOTICE.txt
info:
mtime: '{{ .CommitDate }}'
- src: dependencies.asciidoc
info:
mtime: '{{ .CommitDate }}'
builds_info:
mtime: "{{ .CommitTimestamp }}"
dockers:
- &default-docker-image
id: linux-amd64-image
use: buildx
goos: linux
goarch: amd64
image_templates:
- '{{ .Env.DOCKER_REGISTRY }}/{{ .Env.DOCKER_IMAGE_NAME }}-x86_64:{{ trimprefix .Tag "v" }}'
- "{{ .Env.DOCKER_REGISTRY }}/{{ .Env.DOCKER_IMAGE_NAME }}-x86_64:latest"
build_flag_templates:
- "--platform=linux/amd64"
- "--build-arg=EXTENSION_FILE={{ .ProjectName }}"
- "--build-arg=COMMIT_TIMESTAMP={{ .CommitTimestamp }}"
- "--label=org.opencontainers.image.created={{ .Date }}"
- "--label=org.opencontainers.image.title={{ .ProjectName }}"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.version={{ .Version }}"
extra_files:
- NOTICE.txt
- dependencies.asciidoc
- <<: *default-docker-image
id: linux-arm64-image
goarch: arm64
image_templates:
- '{{ .Env.DOCKER_REGISTRY }}/{{ .Env.DOCKER_IMAGE_NAME }}-arm64:{{ trimprefix .Tag "v" }}'
- "{{ .Env.DOCKER_REGISTRY }}/{{ .Env.DOCKER_IMAGE_NAME }}-arm64:latest"
build_flag_templates:
- "--platform=linux/arm64"
- "--build-arg=EXTENSION_FILE={{ .ProjectName }}"
- "--build-arg=COMMIT_TIMESTAMP={{ .CommitTimestamp }}"
- "--label=org.opencontainers.image.created={{ .Date }}"
- "--label=org.opencontainers.image.title={{ .ProjectName }}"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.version={{ .Version }}"
docker_manifests:
- name_template: '{{ .Env.DOCKER_REGISTRY }}/{{ .Env.DOCKER_IMAGE_NAME }}:{{ trimprefix .Tag "v" }}'
image_templates:
- '{{ .Env.DOCKER_REGISTRY }}/{{ .Env.DOCKER_IMAGE_NAME }}-x86_64:{{ trimprefix .Tag "v" }}'
- '{{ .Env.DOCKER_REGISTRY }}/{{ .Env.DOCKER_IMAGE_NAME }}-arm64:{{ trimprefix .Tag "v" }}'
- name_template: '{{ .Env.DOCKER_REGISTRY }}/{{ .Env.DOCKER_IMAGE_NAME }}:latest'
image_templates:
- "{{ .Env.DOCKER_REGISTRY }}/{{ .Env.DOCKER_IMAGE_NAME }}-x86_64:latest"
- "{{ .Env.DOCKER_REGISTRY }}/{{ .Env.DOCKER_IMAGE_NAME }}-arm64:latest"
publishers:
- name: publish-aws
cmd: ./.ci/publish-aws.sh
env:
- AWS_ACCESS_KEY_ID={{ .Env.AWS_ACCESS_KEY_ID }}
- AWS_SECRET_ACCESS_KEY={{ .Env.AWS_SECRET_ACCESS_KEY }}
- AWS_SESSION_TOKEN={{ .Env.AWS_SESSION_TOKEN }}
- ELASTIC_LAYER_NAME=elastic-apm-extension-ver-{{ replace (trimprefix .Tag "v") "." "-" }}
- VERSION={{ .Tag }}
- ARCHITECTURE={{ if eq .Arch "amd64" }}x86_64{{ else }}{{ .Arch }}{{ end }}
- GOOS={{ .Os }}
- GOARCH={{ .Arch }}
- AWS_FOLDER=.aws-{{ .Os }}-{{ .Arch }}
release:
# Custom GitHub release
disable: true
# creates SBOMs of all archives and the source tarball using syft
# https://goreleaser.com/customization/sbom
sboms:
- artifacts: archive