generated from pulumi/pulumi-tf-provider-boilerplate
-
-
Notifications
You must be signed in to change notification settings - Fork 14
226 lines (200 loc) · 6.23 KB
/
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
---
name: Release
on:
push:
branches:
- main
permissions:
contents: read
pull-requests: read
env:
PROVIDER: proxmoxve
GO111MODULE: "on"
NUGET_FEED_URL: https://api.nuget.org/v3/index.json
jobs:
release:
runs-on: ubuntu-latest
name: Release
outputs:
release_created: ${{ steps.release.outputs.releases_created }}
permissions:
contents: write
pull-requests: write
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
command: manifest
publish_provider:
if: needs.release.outputs.release_created
runs-on: ubuntu-latest
name: Publish Provider
permissions:
id-token: write
contents: write
needs:
- release
strategy:
max-parallel: 4
matrix:
go-version: [1.20.x]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: "${{ matrix.go-version }}"
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
repo: pulumi/pulumictl
- name: Install Pulumi CLI
uses: pulumi/actions@v4
- name: Install cosign
uses: sigstore/[email protected]
- name: Download Syft
uses: anchore/sbom-action/[email protected]
- name: Release via GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
args: -p 3 release --clean --timeout 60m0s
version: latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish_sdk:
if: needs.release.outputs.release_created
runs-on: ubuntu-latest
name: Publish SDK
permissions:
id-token: write
contents: read
needs:
- release
- publish_provider
env:
SIGNING_KEY: ${{ secrets.JAVA_SIGNING_KEY }}
SIGNING_KEY_ID: ${{ secrets.JAVA_SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.JAVA_SIGNING_PASSWORD }}
PUBLISH_REPO_PASSWORD: ${{ secrets.OSS_SONATYPE_PUBLISH_PASSWORD }}
PUBLISH_REPO_USERNAME: ${{ secrets.OSS_SONATYPE_PUBLISH_USERNAME }}
strategy:
max-parallel: 10
matrix:
go-version: [1.20.x]
node-version: [18.x]
dotnet-version: [3.1.301]
python-version: [3.9]
java-version: [11]
language:
- go
- nodejs
- python
- dotnet
# - java # TODO: https://github.com/muhlba91/pulumi-proxmoxve/issues/66
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: "${{ matrix.go-version }}"
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
repo: pulumi/pulumictl
- name: Install Pulumi CLI
uses: pulumi/actions@v4
- name: Setup DotNet
uses: actions/setup-dotnet@v3
with:
dotnet-version: "${{ matrix.dotnet-version }}"
if: matrix.language == 'dotnet'
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python-version }}"
if: matrix.language == 'python'
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "${{ matrix.node-version }}"
if: matrix.language == 'nodejs'
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: corretto
java-version: ${{ matrix.java-version }}
if: matrix.language == 'java'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
if: matrix.language == 'java'
- name: Install Plugins
run: make install_plugins
- name: Update Path
run: echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- name: Build SDK
run: make build_${{ matrix.language }}
- name: Publish .NET SDK
run: |
dotnet nuget push -s "${{ env.NUGET_FEED_URL }}" -k "${{ secrets.NUGET_PUBLISH_KEY }}" ${{github.workspace}}/sdk/dotnet/bin/Debug/*.nupkg
if: matrix.language == 'dotnet'
- name: Publish Python SDK
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
packages-dir: "${{ github.workspace }}/sdk/python/bin/dist/"
if: matrix.language == 'python'
- name: Copy Over NodeJS Scripts
run: cp -rf ${{ github.workspace }}/sdk/nodejs/scripts ${{ github.workspace }}/sdk/nodejs/bin/
if: matrix.language == 'nodejs'
- name: Publish NodeJS SDK
uses: JS-DevTools/npm-publish@v2
with:
package: ./sdk/nodejs/bin/package.json
access: public
token: ${{ secrets.NPM_TOKEN }}
provenance: true
if: matrix.language == 'nodejs'
- name: Java PACKAGE_VERSION
run: echo "PACKAGE_VERSION=$(pulumictl get version --language generic)" >> $GITHUB_ENV
if: matrix.language == 'java'
- name: Publish Java SDK
uses: gradle/gradle-build-action@v2
with:
arguments: publishToSonatype closeAndReleaseSonatypeStagingRepository
build-root-directory: ./sdk/java
if: matrix.language == 'java'
tag_sdk:
if: needs.release.outputs.release_created
runs-on: ubuntu-latest
name: Tag SDK Release
permissions:
id-token: write
contents: write
needs:
- release
- publish_sdk
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Git
run: |
git config --local user.email "${{ env.GITHUB_ACTION }}+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Get Tag Name
run: |
REF_NAME=`git describe --abbrev=0 --tags`
echo "REF_NAME=${REF_NAME}" >> $GITHUB_ENV
- name: Tag SDK Version
run: |
git tag -a sdk/${{ env.REF_NAME }} -m sdk/${{ env.REF_NAME }}
- name: Push to Repository
run: |
git push origin sdk/${{ env.REF_NAME }}