-
Notifications
You must be signed in to change notification settings - Fork 235
186 lines (172 loc) · 5.59 KB
/
release-layer-java.yml
File metadata and controls
186 lines (172 loc) · 5.59 KB
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
name: "Release Javaagent Lambda Layer"
on:
# (Using tag push instead of release to allow filtering by tag prefix.)
push:
tags:
- layer-javaagent/**
permissions:
contents: read
jobs:
create-release:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Create Release
run: gh release create ${{ github.ref_name }} --draft --title ${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-layer:
permissions:
contents: write
runs-on: ubuntu-latest
needs: create-release
outputs:
JAVAAGENT_VERSION: ${{ steps.save-javaagent-version.outputs.JAVAAGENT_VERSION }}
JAVAWRAPPER_VERSION: ${{ steps.save-javawrapper-version.outputs.JAVAWRAPPER_VERSION }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: corretto
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
- name: Execute Gradle build
run: |
cd java
./gradlew :layer-javaagent:assemble :layer-wrapper:assemble --scan --stacktrace
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
name: Save javaagent layer to build
with:
name: opentelemetry-javaagent-layer.zip
path: java/layer-javaagent/build/distributions/opentelemetry-javaagent-layer.zip
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
name: Save javawrapper layer to build
with:
name: opentelemetry-javawrapper-layer.zip
path: java/layer-wrapper/build/distributions/opentelemetry-javawrapper-layer.zip
- name: Add Binary to Release
run: |
gh release upload ${{github.ref_name}} java/layer-wrapper/build/distributions/opentelemetry-javawrapper-layer.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Save Javaagent Version
id: save-javaagent-version
shell: bash
run: |
unzip java/layer-javaagent/build/distributions/opentelemetry-javaagent-layer.zip
JAVAAGENT_VERSION=$(java -jar ./opentelemetry-javaagent.jar)
echo "JAVAAGENT_VERSION=$JAVAAGENT_VERSION" >> $GITHUB_OUTPUT
- name: Save Java Wrapper Version
id: save-javawrapper-version
shell: bash
run: |
cd java
JAVAWRAPPER_VERSION=$(./gradlew layer-wrapper:printOtelJavaInstrumentationVersion -q)
echo "JAVAWRAPPER_VERSION=$JAVAWRAPPER_VERSION" >> $GITHUB_OUTPUT
publish-javaagent-layer:
permissions: # required by the reusable workflow
contents: read
id-token: write
uses: ./.github/workflows/layer-publish.yml
needs: build-layer
strategy:
matrix:
aws_region:
- af-south-1
- ap-east-1
- ap-east-2
- ap-northeast-1
- ap-northeast-2
- ap-south-1
- ap-south-2
- ap-southeast-1
- ap-southeast-2
- ap-southeast-3
- ap-southeast-4
- ap-southeast-5
- ap-southeast-6
- ap-southeast-7
- ca-central-1
- ca-west-1
- eu-central-1
- eu-central-2
- eu-north-1
- eu-south-1
- eu-south-2
- eu-west-1
- eu-west-2
- eu-west-3
- il-central-1
- me-central-1
- me-south-1
- mx-central-1
- sa-east-1
- us-east-1
- us-east-2
- us-west-1
- us-west-2
with:
artifact-name: opentelemetry-javaagent-layer.zip
layer-name: opentelemetry-javaagent
component-version: ${{needs.build-layer.outputs.JAVAAGENT_VERSION}}
# architecture:
# If you add a java runtime here, please make sure that the collector/Makefile publish and publish-layer targets
# get updated as well
runtimes: java8.al2 java11 java17 java21
release-group: prod
aws_region: ${{ matrix.aws_region }}
secrets: inherit
publish-javawrapper-layer:
permissions: # required by the reusable workflow
contents: read
id-token: write
uses: ./.github/workflows/layer-publish.yml
needs: build-layer
strategy:
matrix:
aws_region:
- af-south-1
- ap-east-1
- ap-east-2
- ap-northeast-1
- ap-northeast-2
- ap-south-1
- ap-south-2
- ap-southeast-1
- ap-southeast-2
- ap-southeast-3
- ap-southeast-4
- ap-southeast-5
- ap-southeast-6
- ap-southeast-7
- ca-central-1
- ca-west-1
- eu-central-1
- eu-central-2
- eu-north-1
- eu-south-1
- eu-south-2
- eu-west-1
- eu-west-2
- eu-west-3
- il-central-1
- me-central-1
- me-south-1
- mx-central-1
- sa-east-1
- us-east-1
- us-east-2
- us-west-1
- us-west-2
with:
artifact-name: opentelemetry-javawrapper-layer.zip
layer-name: opentelemetry-javawrapper
component-version: ${{needs.build-layer.outputs.JAVAWRAPPER_VERSION}}
# architecture:
runtimes: java8.al2 java11 java17
release-group: prod
aws_region: ${{ matrix.aws_region }}
secrets: inherit