-
Notifications
You must be signed in to change notification settings - Fork 104
336 lines (336 loc) · 11.5 KB
/
master.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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
env:
AWS_REGION: us-west-2
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LOCAL_PLAT: linux-amd64
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }}
PROVIDER: awsx
PUBLISH_REPO_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
PUBLISH_REPO_USERNAME: ${{ secrets.OSSRH_USERNAME }}
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
PULUMI_API: https://api.pulumi-staging.io
PULUMI_GO_DEP_ROOT: ${{ github.workspace }}/..
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
PYPI_USERNAME: __token__
PYPI_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
PULUMI_LOCAL_NUGET: ${{ github.workspace }}/nuget
SIGNING_KEY: ${{ secrets.JAVA_SIGNING_KEY }}
SIGNING_KEY_ID: ${{ secrets.JAVA_SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.JAVA_SIGNING_PASSWORD }}
VERSION_PREFIX: 1.0.0
GOVERSION: "1.21.x"
DOTNETVERSION: "6.x"
PYTHONVERSION: "3.8"
NODEVERSION: "18.x"
JAVAVERSION: "11"
jobs:
version:
uses: ./.github/workflows/version.yml
secrets: inherit
lint:
name: lint
runs-on: ubuntu-latest
continue-on-error: true
needs: version
env:
PROVIDER_VERSION: ${{ needs.version.outputs.version }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
repo: pulumi/pulumictl
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18.x
registry-url: https://registry.npmjs.org
- name: Install Yarn
run: curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.13.0
- name: Update PATH for Yarn
run: |
echo "$HOME/.yarn/bin" >> $GITHUB_PATH
echo "$HOME/.config/yarn/global/node_modules/.bin" >> $GITHUB_PATH
- name: Lint AWSX Code
run: make lint
- name: Lint classic AWSX Code
run: make lint_classic
- name: Check worktree clean
uses: pulumi/git-status-check-action@v1
with:
allowed-changes: |
sdk/**/pulumi-plugin.json
sdk/dotnet/Pulumi.*.csproj
sdk/go/**/pulumiUtilities.go
sdk/nodejs/package.json
sdk/python/pyproject.toml
build-provider:
runs-on: ubuntu-latest
needs: version
env:
PROVIDER_VERSION: ${{ needs.version.outputs.version }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v3
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-region: ${{ env.AWS_REGION }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
role-duration-seconds: 7200
role-session-name: ${{ env.PROVIDER }}@githubActions
role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }}
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GOVERSION }}
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{env.NODEVERSION}}
registry-url: https://registry.npmjs.org
- name: Install Yarn
run: curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.13.0
- name: Update PATH for Yarn
run: |
echo "$HOME/.yarn/bin" >> $GITHUB_PATH
echo "$HOME/.config/yarn/global/node_modules/.bin" >> $GITHUB_PATH
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
repo: pulumi/pulumictl
- name: Install Pulumi CLI
uses: pulumi/action-install-pulumi-cli@v2
- name: Build provider
run: make provider
- name: Test provider
run: make test_provider
- name: Check worktree clean
uses: pulumi/git-status-check-action@v1
with:
allowed-changes: |
sdk/**/pulumi-plugin.json
sdk/dotnet/Pulumi.*.csproj
sdk/go/**/pulumiUtilities.go
sdk/nodejs/package.json
sdk/python/pyproject.toml
- name: Upload bin
uses: actions/upload-artifact@v3
with:
name: bin
path: bin
- name: Tar provider bin
run: tar -zcf ${{ github.workspace }}/provider.tar.gz -C ${{ github.workspace }}/${{ env.PROVIDER }}/bin/ .
- name: Upload provider bin
uses: actions/upload-artifact@v3
with:
name: ${{ env.PROVIDER }}-provider.tar.gz
path: ${{ github.workspace }}/provider.tar.gz
- if: failure() && github.event_name == 'push'
name: Notify Slack
uses: 8398a7/action-slack@v3
with:
author_name: Failure in building provider
fields: repo,commit,author,action
status: ${{ job.status }}
acceptance-test:
runs-on: ubuntu-latest
needs:
- build-provider
- version
env:
PROVIDER_VERSION: ${{ needs.version.outputs.version }}
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/[email protected]
with:
tool-cache: false
swap-storage: false
- name: Checkout Repo
uses: actions/checkout@v4
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
repo: pulumi/pulumictl
- name: Install Languages & Frameworks
uses: ./.github/actions/install
- name: Setup Gradle
uses: gradle/gradle-build-action@v3
with:
gradle-version: "8.4"
- name: Install Python deps
run: |-
pip3 install virtualenv==20.0.23
pip3 install pipenv
- name: Download bin
uses: actions/download-artifact@v3
with:
name: bin
path: bin
- name: Restore bin and avoid rebuilding
run: |
chmod +x bin/*
make provider --touch
- name: Build SDK
run: make build_${{ matrix.language }}
- name: Check worktree clean
uses: pulumi/git-status-check-action@v1
with:
allowed-changes: |
sdk/**/pulumi-plugin.json
sdk/dotnet/Pulumi.*.csproj
sdk/go/**/pulumiUtilities.go
sdk/nodejs/package.json
sdk/python/pyproject.toml
- name: Compress SDK folder
run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }}
.
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.language }}-sdk.tar.gz
path: ${{ github.workspace}}/sdk/${{ matrix.language }}.tar.gz
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v3
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-region: ${{ env.AWS_REGION }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
role-duration-seconds: 7200
role-session-name: ${{ env.PROVIDER }}@githubActions
role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }}
- name: Run tests
# Tell make to not rebuild the provider bin
run: make test_${{ matrix.language }}
strategy:
fail-fast: false
matrix:
language:
- nodejs
- python
- dotnet
- go
- java
publish:
name: publish
runs-on: ubuntu-latest
needs:
- acceptance-test
- version
env:
PROVIDER_VERSION: ${{ needs.version.outputs.version }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v3
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-region: us-east-2
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
role-duration-seconds: 7200
role-external-id: upload-pulumi-release
role-session-name: ${{ env.PROVIDER}}@githubActions
role-to-assume: ${{ secrets.AWS_UPLOAD_ROLE_ARN }}
- uses: MOZGIII/install-ldid-action@v1
with:
tag: v2.1.5-procursus2
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
repo: pulumi/pulumictl
- name: Install Pulumi CLI
uses: pulumi/action-install-pulumi-cli@v2
- name: Download provider binary
uses: actions/download-artifact@v3
with:
name: ${{ env.PROVIDER }}-provider.tar.gz
path: ${{ github.workspace }}/bin
- name: Untar provider binaries
run: tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ github.workspace
}}/bin
- name: Restore binary perms
run: find ${{ github.workspace }}/bin -name "pulumi-*-${{ env.PROVIDER }}" -print
-exec chmod +x {} \;
- name: Test provider
run: make test_provider
- name: Create Provider Binaries
run: make dist
- name: Upload Provider Binaries
run: aws s3 cp dist s3://get.pulumi.com/releases/plugins/ --recursive
publish_sdk:
name: publish_sdk
runs-on: ubuntu-latest
needs:
- publish
- version
env:
PROVIDER_VERSION: ${{ needs.version.outputs.version }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
repo: pulumi/pulumictl
- name: Install Languages & Frameworks
uses: ./.github/actions/install
- name: Setup Gradle
uses: gradle/gradle-build-action@v3
with:
gradle-version: "8.4"
- name: Download python SDK
uses: actions/download-artifact@v3
with:
name: python-sdk.tar.gz
path: ${{ github.workspace}}/sdk/
- name: Uncompress python SDK
run: tar -zxf ${{github.workspace}}/sdk/python.tar.gz -C ${{github.workspace}}/sdk/python
- name: Download dotnet SDK
uses: actions/download-artifact@v3
with:
name: dotnet-sdk.tar.gz
path: ${{ github.workspace}}/sdk/
- name: Uncompress dotnet SDK
run: tar -zxf ${{github.workspace}}/sdk/dotnet.tar.gz -C ${{github.workspace}}/sdk/dotnet
- name: Download nodejs SDK
uses: actions/download-artifact@v3
with:
name: nodejs-sdk.tar.gz
path: ${{ github.workspace}}/sdk/
- name: Uncompress nodejs SDK
run: tar -zxf ${{github.workspace}}/sdk/nodejs.tar.gz -C ${{github.workspace}}/sdk/nodejs
- run: python -m pip install pip twine
- env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
name: Publish SDK
run: ./scripts/publish_packages.sh
- name: Download java SDK
uses: actions/download-artifact@v3
with:
name: java-sdk.tar.gz
path: ${{ github.workspace}}/sdk/
- name: Uncompress java SDK
run: tar -zxf ${{github.workspace}}/sdk/java.tar.gz -C ${{github.workspace}}/sdk/java
- name: Publish Java SDK
uses: gradle/gradle-build-action@a8f75513eafdebd8141bd1cd4e30fcd194af8dfa
env:
PACKAGE_VERSION: ${{ env.PROVIDER_VERSION }}
with:
arguments: publishToSonatype closeAndReleaseSonatypeStagingRepository
build-root-directory: ./sdk/java
gradle-version: 7.4.1
name: master
"on":
push:
branches:
- master
paths-ignore:
- CHANGELOG.md
tags-ignore:
- v*
- sdk/*
- "**"