-
Notifications
You must be signed in to change notification settings - Fork 1
217 lines (181 loc) · 6.63 KB
/
release.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
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
name: release
on:
push:
tags:
- v*.*.*
permissions:
contents: write
env:
PROVIDER: rediscloud
TF_APPEND_USER_AGENT: pulumi
# GitHub Release Artifacts (Provider)
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Go SDK
PULUMI_GO_DEP_ROOT: ${{ github.workspace }}/..
# NodeJS SDK
NPM_PUBLISH: true
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# dotNet SDK
NUGET_PUBLISH: false
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
NUGET_FEED_URL: https://api.nuget.org/v3/index.json
PULUMI_LOCAL_NUGET: ${{ github.workspace }}/nuget
# Python SDK
PYPI_PUBLISH: true
PYPI_PASSWORD: ${{ secrets.PYPI_TOKEN }}
PYPI_USERNAME: "__token__"
# Java SDK
JAVAVERSION: "11"
JAVA_PUBLISH: "true"
PUBLISH_REPO_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
PUBLISH_REPO_USERNAME: ${{ secrets.OSSRH_USERNAME }}
SIGNING_KEY: ${{ secrets.JAVA_SIGNING_KEY }}
SIGNING_KEY_ID: ${{ secrets.JAVA_SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.JAVA_SIGNING_PASSWORD }}\
jobs:
publish-provider:
name: publish
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # tag=v3.5.2
- name: Set Tag Version
run: echo "GORELEASER_CURRENT_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Install Go
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # tag=v4.0.0
with:
go-version: ${{matrix.goversion}}
- name: Install pulumictl
uses: jaxxstorm/action-install-gh-release@c5ead9a448b4660cf1e7866ee22e4dc56538031a # tag=v1.10.0
with:
repo: pulumi/pulumictl
tag: v0.0.43
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@f82d6c1c344bcacabba2c841718984797f664a6b # tag=v4.2.0
with:
args: -p 3 release --rm-dist
version: latest
- name: Create ag
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # tag=v6.4.1
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/sdk/${{ github.ref_name }}',
sha: context.sha
})
strategy:
fail-fast: true
matrix:
goversion:
- 1.19.x
publish-sdks:
name: Publish ${{ matrix.language }} SDK
runs-on: ubuntu-latest
needs: publish-provider
steps:
- name: Checkout Repo
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # tag=v3.5.2
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Install Go
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # tag=v4.0.0
with:
go-version: ${{ matrix.goversion }}
- name: Install pulumictl
uses: jaxxstorm/action-install-gh-release@c5ead9a448b4660cf1e7866ee22e4dc56538031a # tag=v1.10.0
with:
repo: pulumi/pulumictl
tag: v0.0.43
- name: Install Pulumi CLI
uses: pulumi/action-install-pulumi-cli@b374ceb6168550de27c6eba92e01c1a774040e11 # tag=v2.0.0
- name: pulumi-java-gen
run: mkdir -p bin && pulumictl download-binary -n pulumi-language-java -v v0.9.4 -r pulumi/pulumi-java
- name: AWS Provider
run: pulumi plugin install resource aws 5.40.0
- name: Google Provider
run: pulumi plugin install resource gcp 6.55.1
- name: Setup Node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # tag=v3.6.0
with:
node-version: ${{matrix.nodeversion}}
registry-url: ${{env.NPM_REGISTRY_URL}}
- name: Setup DotNet
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a # tag=v2.1.0
with:
dotnet-version: ${{matrix.dotnetverson}}
- name: Setup Python
uses: actions/setup-python@57ded4d7d5e986d7296eab16560982c6dd7c923b # tag=v4.2.0
with:
python-version: ${{matrix.pythonversion}}
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: ${{ env.JAVAVERSION }}
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-version: "7.6"
- name: Build SDK
run: make build_${{ matrix.language }}
- name: Check worktree clean
run: |
git update-index -q --refresh
if ! git diff-files --quiet; then
>&2 echo "error: working tree is not clean, aborting!"
git status
git diff
exit 1
fi
- if: ${{ matrix.language == 'python' && env.PYPI_PUBLISH == 'true' }}
name: Publish PyPI
uses: pypa/gh-action-pypi-publish@a56da0b891b3dc519c7ee3284aff1fad93cc8598 # tag=v1.8.6
with:
user: ${{ env.PYPI_USERNAME }}
password: ${{ env.PYPI_PASSWORD }}
packages-dir: ${{github.workspace}}/sdk/python/bin/dist
- if: ${{ matrix.language == 'nodejs' && env.NPM_PUBLISH == 'true' }}
uses: JS-DevTools/npm-publish@541aa6b21b4a1e9990c95a92c21adc16b35e9551 # tag=v2.1.0
with:
access: "public"
token: ${{ env.NPM_TOKEN }}
package: ${{github.workspace}}/sdk/nodejs/bin/package.json
- if: ${{ matrix.language == 'dotnet' && env.NUGET_PUBLISH == 'true' }}
name: publish nuget package
run: |
dotnet nuget push ${{github.workspace}}/sdk/dotnet/bin/Debug/*.nupkg -s ${{ env.NUGET_FEED_URL }} -k ${{ env.NUGET_API_KEY }}
echo "done publishing packages"
- if: ${{ matrix.language == 'java' && env.JAVA_PUBLISH == 'true' }}
name: Set PACKAGE_VERSION to Env
run: echo "PACKAGE_VERSION=$(pulumictl get version --language generic)" >>
$GITHUB_ENV
shell: bash
- if: ${{ matrix.language == 'java' && env.JAVA_PUBLISH == 'true' }}
name: Publish Java SDK
uses: gradle/gradle-build-action@9b814496b50909128c6a52622b416c5ffa04db49
with:
arguments: --stacktrace --debug --scan publishToSonatype closeAndReleaseSonatypeStagingRepository
build-root-directory: ./sdk/java
gradle-version: 7.4.1
strategy:
fail-fast: true
matrix:
dotnetversion:
- 3.1.301
goversion:
- 1.20.x
language:
- nodejs
- python
- dotnet
- go
- java
nodeversion:
- 16.x
pythonversion:
- "3.9"