77
88permissions :
99 contents : write
10+ # Required for OIDC authentication with PyPI
11+ id-token : write
1012
1113jobs :
1214 release :
1315 name : Create Release
1416 runs-on : ubuntu-latest
17+ outputs :
18+ version : ${{ steps.version.outputs.VERSION }}
1519
1620 steps :
1721 - name : Checkout code
2529 go-version : ' 1.24'
2630 cache-dependency-path : provider/go.sum
2731
32+ - name : Install pulumictl
33+ run : |
34+ PULUMICTL_VERSION=v0.0.50
35+ curl -fsSL https://github.com/pulumi/pulumictl/releases/download/${PULUMICTL_VERSION}/pulumictl-${PULUMICTL_VERSION}-linux-amd64.tar.gz | tar -xz
36+ sudo mv pulumictl /usr/local/bin/
37+ pulumictl version
38+
2839 - name : Get version
2940 id : version
3041 run : echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
3950 - name : Create Release
4051 uses : softprops/action-gh-release@v1
4152 with :
42- files : |
43- bin/pulumi-resource-clevercloud-${{ steps.version.outputs.VERSION }}-linux-amd64.tar.gz
53+ files : bin/pulumi-resource-clevercloud-${{ steps.version.outputs.VERSION }}-linux-amd64.tar.gz
4454 generate_release_notes : true
4555 draft : false
4656 prerelease : ${{ contains(steps.version.outputs.VERSION, '-') }}
@@ -49,15 +59,12 @@ jobs:
4959 name : Publish SDKs
5060 needs : release
5161 runs-on : ubuntu-latest
52- permissions :
53- contents : read
54- # Required for OIDC authentication with PyPI
55- id-token : write
5662
5763 steps :
5864 - name : Checkout code
5965 uses : actions/checkout@v4
6066 with :
67+ ref : ${{ needs.release.outputs.version }}
6168 fetch-depth : 0
6269
6370 - name : Set up Go
@@ -69,22 +76,32 @@ jobs:
6976 - name : Set up Node.js
7077 uses : actions/setup-node@v4
7178 with :
72- node-version : ' 20 '
79+ node-version : ' 24 '
7380 registry-url : ' https://registry.npmjs.org'
7481
7582 - name : Set up Python
7683 uses : actions/setup-python@v5
7784 with :
7885 python-version : ' 3.12'
7986
87+ - name : Install pulumictl
88+ run : |
89+ PULUMICTL_VERSION=v0.0.50
90+ curl -fsSL https://github.com/pulumi/pulumictl/releases/download/${PULUMICTL_VERSION}/pulumictl-${PULUMICTL_VERSION}-linux-amd64.tar.gz | tar -xz
91+ sudo mv pulumictl /usr/local/bin/
92+ pulumictl version
93+
94+ - name : Install Python build tools
95+ run : pip install build
96+
8097 - name : Set up .NET
8198 uses : actions/setup-dotnet@v4
8299 with :
83- dotnet-version : ' 8 .0'
100+ dotnet-version : ' 10 .0'
84101
85102 - name : Install pulumictl
86103 run : |
87- PULUMICTL_VERSION=v0.0.46
104+ PULUMICTL_VERSION=v0.0.50
88105 curl -fsSL https://github.com/pulumi/pulumictl/releases/download/${PULUMICTL_VERSION}/pulumictl-${PULUMICTL_VERSION}-linux-amd64.tar.gz | tar -xz
89106 sudo mv pulumictl /usr/local/bin/
90107 pulumictl version
@@ -94,21 +111,28 @@ jobs:
94111
95112 - name : Publish to npm
96113 working-directory : sdk/nodejs
97- run : npm publish
98-
99- - name : Build Python package
100- working-directory : sdk/python
101- run : |
102- pip install build
103- python -m build
114+ run : npm publish --access public --verbose
104115
105116 - name : Publish to PyPI
106117 uses : pypa/gh-action-pypi-publish@release/v1
107118 with :
108119 packages-dir : sdk/python/dist/
120+ env :
121+ name : pypi
122+ url : https://pypi.org/p/pulumi-clevercloud
123+
124+ # Get a short-lived NuGet API key
125+ # https://learn.microsoft.com/en-us/nuget/nuget-org/trusted-publishing
126+ - name : NuGet login (OIDC → temp API key)
127+ uses : NuGet/login@v1
128+ id : login
129+ with :
130+ user : " ${{ secrets.NUGET_USER }}"
109131
110132 - name : Publish to NuGet
111133 working-directory : sdk/dotnet
112134 run : |
113- dotnet pack
114- dotnet nuget push bin/Release/*.nupkg --api-key ${{ secrets.NUGET_TOKEN }} --source https://api.nuget.org/v3/index.json
135+ dotnet nuget push bin/Release/*.nupkg \
136+ --skip-duplicate \
137+ --api-key ${{steps.login.outputs.NUGET_API_KEY}} \
138+ --source https://api.nuget.org/v3/index.json
0 commit comments