-
Notifications
You must be signed in to change notification settings - Fork 0
218 lines (216 loc) · 7.13 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
218
name: release
"on":
push:
tags:
- v*.*.*
- "!v*.*.*-**"
env:
PROVIDER: kubeconfig
GO_VERSION: "1.22.x"
NODEJS_VERSION: 20.x
DOTNET_VERSION: 6.0.302
PYTHON_VERSION: "3.12"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
build_provider:
name: Build Provider
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Set Provider Version
uses: pulumi/provider-version-action@v1
with:
set-env: PROVIDER_VERSION
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{env.GO_VERSION}}
cache-dependency-path: "**/*.sum"
- name: Install pulumictl
uses: jaxxstorm/action-install-gh-release@v1.12.0
with:
repo: pulumi/pulumictl
- name: Install Pulumi CLI
uses: pulumi/actions@v5
- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build provider binary
run: task build_provider
- name: Check for presence of binary
run: ls ${{ github.workspace}}/bin/
- name: Tar provider binaries
run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ github.workspace }}/bin/ pulumi-resource-${{ env.PROVIDER }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.PROVIDER }}-provider.tar.gz
path: ${{ github.workspace }}/bin/provider.tar.gz
strategy:
fail-fast: true
matrix:
goversion:
- 1.22.x
build_sdks:
name: Build SDKs
runs-on: ubuntu-latest
needs: build_provider
strategy:
fail-fast: true
matrix:
language:
- nodejs
- python
- dotnet
- go
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Set Provider Version
uses: pulumi/provider-version-action@v1
with:
set-env: PROVIDER_VERSION
- if: matrix.language == 'go'
name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{env.GO_VERSION}}
cache-dependency-path: "**/*.sum"
- if: matrix.language == 'nodejs'
name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{env.NODEJS_VERSION}}
- if: matrix.language == 'dotnet'
name: Setup DotNet
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{env.DOTNET_VERSION}}
- if: matrix.language == 'python'
name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{env.PYTHON_VERSION}}
- name: Install Pulumi CLI
uses: pulumi/actions@v5
- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install pulumictl
uses: jaxxstorm/action-install-gh-release@v1.12.0
with:
repo: pulumi/pulumictl
- name: Download provider binaries
uses: actions/download-artifact@v4
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
find ${{ github.workspace }} -name "pulumi-*-${{ env.PROVIDER }}" -print -exec chmod +x {} \;
- name: Update path
run: echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- name: Build SDKs
run: task generate_${{matrix.language}}_sdk
- name: Check worktree clean
uses: pulumi/git-status-check-action@v1
with:
allowed-changes: |-
sdk/**/pulumi-plugin.json
sdk/dotnet/PiersKarsenbarg.*.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@v4
with:
name: ${{ matrix.language }}.tar.gz
path: ${{ github.workspace}}/sdk/${{ matrix.language }}.tar.gz
publish_provider:
runs-on: ubuntu-latest
needs: build_sdks
name: publish_provider
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{env.GO_VERSION}}
cache-dependency-path: "**/*.sum"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
args: release --clean --timeout 60m0s
version: "~> v2"
strategy:
fail-fast: true
publish_sdks:
runs-on: ubuntu-latest
needs: publish_provider
permissions:
id-token: write
strategy:
fail-fast: true
matrix:
language:
- nodejs
- python
- dotnet
steps:
- if: matrix.language == 'nodejs'
name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{env.NODEJS_VERSION}}
registry-url: https://registry.npmjs.org
- if: matrix.language == 'dotnet'
name: Setup DotNet
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{env.DOTNET_VERSION}}
- if: matrix.language == 'python'
name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{env.PYTHON_VERSION}}
- name: Download ${{matrix.language}} SDK
uses: actions/download-artifact@v4
with:
name: ${{matrix.language}}.tar.gz
path: ${{ github.workspace}}/sdk/
- name: Create ${{matrix.language}} directory
run: mkdir -p ${{github.workspace}}/sdk/${{matrix.language}}
- name: Uncompress ${{matrix.language}} SDK
run: tar -zxf ${{github.workspace}}/sdk/${{matrix.language}}.tar.gz -C ${{github.workspace}}/sdk/${{matrix.language}}
- if: matrix.language == 'python'
name: Publish PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: ${{github.workspace}}/sdk/python/bin/dist
- if: matrix.language == 'nodejs'
name: Publish NPM package
uses: JS-DevTools/npm-publish@v3
with:
access: "public"
token: ${{ secrets.NPM_TOKEN }}
package: ${{github.workspace}}/sdk/nodejs/bin/package.json
- if: matrix.language == 'dotnet'
name: Publish Nuget package
env:
NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }}
run: find "${{github.workspace}}/sdk/dotnet/bin/Release/" -name 'PiersKarsenbarg.*.nupkg' -exec dotnet nuget push -k "${NUGET_PUBLISH_KEY}" -s https://api.nuget.org/v3/index.json {} ';'