forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
253 lines (244 loc) · 8.98 KB
/
mobile-release.yml
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
name: mobile_release
permissions:
contents: read
on:
workflow_dispatch:
schedule:
# Mondays at 1pm UTC (8am EST)
- cron: "0 13 * * 1"
jobs:
env:
if: ${{ github.repository == 'envoyproxy/envoy' }}
uses: ./.github/workflows/_load.yml
permissions:
contents: read
pull-requests: read
android_release_artifacts:
if: >-
${{
github.repository == 'envoyproxy/envoy'
&& (github.event.schedule
|| !contains(github.actor, '[bot]'))
}}
needs: env
permissions:
contents: read
packages: read
name: android_release_artifacts
runs-on: ${{ fromJSON(needs.request.outputs.request).ci.agent-ubuntu }}
timeout-minutes: 120
container:
image: ${{ needs.env.outputs.build-image-mobile }}
env:
CC: /opt/llvm/bin/clang
CXX: /opt/llvm/bin/clang++
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Add safe directory
run: git config --global --add safe.directory /__w/envoy/envoy
- name: 'Build envoy.aar distributable'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: mobile
run: |
version="0.5.0.$(date '+%Y%m%d')"
./bazelw build \
--config=mobile-remote-release-clang \
--remote_header="Authorization=Bearer $GITHUB_TOKEN" \
--fat_apk_cpu=x86,x86_64,armeabi-v7a,arm64-v8a \
--define=pom_version="$version" \
--config=mobile-release-android \
--linkopt=-fuse-ld=lld \
//:android_dist
- name: 'Tar artifacts'
run: |
tar -czvf envoy_android_aar_sources.tar.gz \
bazel-bin/library/kotlin/io/envoyproxy/envoymobile/envoy.aar \
bazel-bin/library/kotlin/io/envoyproxy/envoymobile/envoy-pom.xml \
bazel-bin/library/kotlin/io/envoyproxy/envoymobile/envoy-sources.jar \
bazel-bin/library/kotlin/io/envoyproxy/envoymobile/envoy-javadoc.jar
working-directory: mobile
- uses: actions/upload-artifact@v3
with:
name: envoy_android_aar_sources
path: mobile/envoy_android_aar_sources.tar.gz
android_release_deploy:
name: android_release_deploy
needs: android_release_artifacts
permissions:
contents: read
packages: read
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Add safe directory
run: git config --global --add safe.directory /__w/envoy/envoy
- uses: actions/download-artifact@v3
with:
name: envoy_android_aar_sources
path: .
- name: Expand archive
run: |
tar -xvf envoy_android_aar_sources.tar.gz
mv bazel-bin/library/kotlin/io/envoyproxy/envoymobile/* .
- name: 'Configure gpg signing'
env:
GPG_KEY: ${{ secrets.EM_GPG_KEY }}
GPG_KEY_NAME: ${{ secrets.EM_GPG_KEY_NAME }}
GPG_PASSPHRASE: ${{ secrets.EM_GPG_PASSPHRASE }}
run: |
# https://github.com/keybase/keybase-issues/issues/2798
export GPG_TTY=$(tty)
# Import gpg keys and warm the passphrase to avoid the gpg
# passphrase prompt when initating a deploy
# `--pinentry-mode=loopback` could be needed to ensure we
# suppress the gpg prompt
echo $GPG_KEY | base64 --decode > signing-key
gpg --passphrase $GPG_PASSPHRASE --batch --import signing-key
shred signing-key
gpg --pinentry-mode=loopback --passphrase $GPG_PASSPHRASE -ab envoy.aar
gpg --pinentry-mode=loopback --passphrase $GPG_PASSPHRASE -ab envoy-pom.xml
gpg --pinentry-mode=loopback --passphrase $GPG_PASSPHRASE -ab envoy-javadoc.jar
gpg --pinentry-mode=loopback --passphrase $GPG_PASSPHRASE -ab envoy-sources.jar
- name: 'Release to sonatype repository'
env:
READWRITE_USER: ${{ secrets.EM_SONATYPE_USER }}
READWRITE_API_KEY: ${{ secrets.EM_SONATYPE_PASSWORD }}
SONATYPE_PROFILE_ID: ${{ secrets.EM_SONATYPE_PROFILE_ID }}
run: |
version="0.5.0.$(date '+%Y%m%d')"
python mobile/ci/sonatype_nexus_upload.py \
--profile_id=$SONATYPE_PROFILE_ID \
--artifact_id=envoy \
--version=$version \
--files \
envoy.aar \
envoy-pom.xml \
envoy-sources.jar \
envoy-javadoc.jar \
--signed_files \
envoy.aar.asc \
envoy-pom.xml.asc \
envoy-sources.jar.asc \
envoy-javadoc.jar.asc
android_xds_release_artifacts:
if: >-
${{
github.repository == 'envoyproxy/envoy'
&& (github.event.schedule
|| !contains(github.actor, '[bot]'))
}}
needs: env
permissions:
contents: read
packages: read
name: android_xds_release_artifacts
runs-on: ${{ fromJSON(needs.env.outputs.request).ci.agent-ubuntu }}
timeout-minutes: 120
container:
image: ${{ needs.env.outputs.build-image-mobile }}
env:
CC: /opt/llvm/bin/clang
CXX: /opt/llvm/bin/clang++
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Add safe directory
run: git config --global --add safe.directory /__w/envoy/envoy
- name: 'Build envoy_xds.aar distributable'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: mobile
run: |
# --define=envoy_mobile_xds=enabled must be defined last because
# --config=mobile-release-android has --define=envoy_mobile_xds=disabled
version="0.5.0.$(date '+%Y%m%d')"
./bazelw build \
--config=mobile-remote-release-clang \
--remote_header="Authorization=Bearer $GITHUB_TOKEN" \
--fat_apk_cpu=x86,x86_64,armeabi-v7a,arm64-v8a \
--define=pom_version="$version" \
--config=mobile-release-android \
--define=envoy_mobile_xds=enabled \
--linkopt=-fuse-ld=lld \
//:android_xds_dist
- name: 'Tar artifacts'
run: |
tar -czvf envoy_xds_android_aar_sources.tar.gz \
bazel-bin/library/kotlin/io/envoyproxy/envoymobile/envoy_xds.aar \
bazel-bin/library/kotlin/io/envoyproxy/envoymobile/envoy_xds-pom.xml \
bazel-bin/library/kotlin/io/envoyproxy/envoymobile/envoy_xds-sources.jar \
bazel-bin/library/kotlin/io/envoyproxy/envoymobile/envoy_xds-javadoc.jar
working-directory: mobile
- uses: actions/upload-artifact@v3
with:
name: envoy_xds_android_aar_sources
path: mobile/envoy_xds_android_aar_sources.tar.gz
android_xds_release_deploy:
name: android_xds_release_deploy
needs: android_xds_release_artifacts
permissions:
contents: read
packages: read
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Add safe directory
run: git config --global --add safe.directory /__w/envoy/envoy
- uses: actions/download-artifact@v3
with:
name: envoy_xds_android_aar_sources
path: .
- name: Expand archive
run: |
tar -xvf envoy_xds_android_aar_sources.tar.gz
mv bazel-bin/library/kotlin/io/envoyproxy/envoymobile/* .
- name: 'Configure gpg signing'
env:
GPG_KEY: ${{ secrets.EM_GPG_KEY }}
GPG_KEY_NAME: ${{ secrets.EM_GPG_KEY_NAME }}
GPG_PASSPHRASE: ${{ secrets.EM_GPG_PASSPHRASE }}
run: |
# https://github.com/keybase/keybase-issues/issues/2798
export GPG_TTY=$(tty)
# Import gpg keys and warm the passphrase to avoid the gpg
# passphrase prompt when initating a deploy
# `--pinentry-mode=loopback` could be needed to ensure we
# suppress the gpg prompt
echo $GPG_KEY | base64 --decode > signing-key
gpg --passphrase $GPG_PASSPHRASE --batch --import signing-key
shred signing-key
gpg --pinentry-mode=loopback --passphrase $GPG_PASSPHRASE -ab envoy_xds.aar
gpg --pinentry-mode=loopback --passphrase $GPG_PASSPHRASE -ab envoy_xds-pom.xml
gpg --pinentry-mode=loopback --passphrase $GPG_PASSPHRASE -ab envoy_xds-javadoc.jar
gpg --pinentry-mode=loopback --passphrase $GPG_PASSPHRASE -ab envoy_xds-sources.jar
- name: 'Release to sonatype repository'
env:
READWRITE_USER: ${{ secrets.EM_SONATYPE_USER }}
READWRITE_API_KEY: ${{ secrets.EM_SONATYPE_PASSWORD }}
SONATYPE_PROFILE_ID: ${{ secrets.EM_SONATYPE_PROFILE_ID }}
run: |
version="0.5.0.$(date '+%Y%m%d')"
python mobile/ci/sonatype_nexus_upload.py \
--profile_id=$SONATYPE_PROFILE_ID \
--artifact_id=envoy-xds \
--version=$version \
--files \
envoy_xds.aar \
envoy_xds-pom.xml \
envoy_xds-sources.jar \
envoy_xds-javadoc.jar \
--signed_files \
envoy_xds.aar.asc \
envoy_xds-pom.xml.asc \
envoy_xds-sources.jar.asc \
envoy_xds-javadoc.jar.asc