88permissions :
99 contents : write
1010 id-token : write
11+ packages : write
1112
1213env :
13- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
14+ GITHUB_TOKEN : ${{ secrets.PR_TOKEN }}
1415 NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
1516 NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
16- NUGET_PUBLISH_KEY : ${{ secrets.NUGET_PUBLISH_KEY }}
17- NUGET_FEED_URL : https://api.nuget.org/v3/index.json
1817 PROVIDER : stackit
1918 PULUMI_GO_DEP_ROOT : ${{ github.workspace }}/..
20- PULUMI_LOCAL_NUGET : ${{ github.workspace }}/nuget
21- PYPI_PASSWORD : ${{ secrets.PYPI_PASSWORD }}
22- PYPI_USERNAME : " __token__"
23- PUBLISH_PYPI : true
24- PUBLISH_NPM : true
25- PUBLISH_NUGET : true
19+ # TODO: change to true if ready to release
20+ PUBLISH_NPM : false
21+ # NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }}
22+ # NUGET_FEED_URL: https://api.nuget.org/v3/index.json
23+ # PULUMI_LOCAL_NUGET: ${{ github.workspace }}/nuget
24+ # PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
25+ # PYPI_USERNAME: "__token__"
26+ # PUBLISH_PYPI: true
27+ # PUBLISH_NUGET: true
2628jobs :
2729 publish_binary :
28- name : publish
30+ name : Publish provider
2931 runs-on : ubuntu-latest
3032 steps :
33+ # TODO: remove when this repo is made public
34+ - name : Configure Git for Private Modules
35+ run : |
36+ git config --global url."https://oauth2:${{ secrets.PR_TOKEN }}@github.com".insteadOf "https://github.com"
37+ # Sets GOPRIVATE and GONOSUMDB in order to use the git authetnication for go mod.
38+ echo "GOPRIVATE=github.com/${{ github.repository }}/*,github.com/stackitcloud/*" >> $GITHUB_ENV
39+ echo "GONOSUMDB=github.com/${{ github.repository }}/*,github.com/stackitcloud/*" >> $GITHUB_ENV
40+ # TODO: remove end
3141 - name : Checkout Repo
3242 uses : actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # tag=v4.2.2
3343 - name : Unshallow clone for tags
@@ -40,61 +50,44 @@ jobs:
4050 uses : ./.github/actions/gotools
4151 with :
4252 go-version : ${{ matrix.goversion }}
43- - name : Set PreRelease Version
44- run : echo "GORELEASER_CURRENT_TAG=v$(pulumictl get version --language generic)" >> $GITHUB_ENV
4553 - uses : sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad # v4.0.0
4654 - uses : anchore/sbom-action/download-syft@fbfd9c6c189226748411491745178e0c2017392d # v0.20.10
4755 - name : Run GoReleaser
4856 uses : goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # tag=v6.3.0
4957 with :
5058 args : -p 3 release --clean
5159 version : ' ~> v2'
52- - name : Create tag
53- uses : actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # tag=v8.0.0
54- with :
55- script : |
56- github.rest.git.createRef({
57- owner: context.repo.owner,
58- repo: context.repo.repo,
59- ref: 'refs/tags/sdk/${{ github.ref_name }}',
60- sha: context.sha
61- })
6260 strategy :
6361 fail-fast : true
6462 matrix :
6563 goversion :
6664 - 1.24.x
6765 publish_sdk :
68- name : Publish SDKs
66+ name : Publish SDKs to npm Registry, NuGet Gallery and Python Package Index
6967 runs-on : ubuntu-latest
7068 needs : publish_binary
7169 steps :
70+ # TODO: remove when this repo is made public
71+ - name : Configure Git for Private Modules
72+ run : |
73+ git config --global url."https://oauth2:${{ secrets.PR_TOKEN }}@github.com".insteadOf "https://github.com"
74+ # Sets GOPRIVATE and GONOSUMDB in order to use the git authetnication for go mod.
75+ echo "GOPRIVATE=github.com/${{ github.repository }}/*,github.com/stackitcloud/*" >> $GITHUB_ENV
76+ echo "GONOSUMDB=github.com/${{ github.repository }}/*,github.com/stackitcloud/*" >> $GITHUB_ENV
77+ # TODO: remove end
7278 - name : Checkout Repo
7379 uses : actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # tag=v4.2.2
7480 - name : Unshallow clone for tags
7581 run : git fetch --prune --unshallow --tags
76- - name : Install pulumictl
77- uses : jaxxstorm/action-install-gh-release@6096f2a2bbfee498ced520b6922ac2c06e990ed2 # tag=v2.1.0
78- with :
79- repo : pulumi/pulumictl
80- - name : Install Pulumi CLI
81- uses : pulumi/action-install-pulumi-cli@b374ceb6168550de27c6eba92e01c1a774040e11 # tag=v2.0.0
8282 - name : Install Go Tools
8383 uses : ./.github/actions/gotools
8484 with :
8585 go-version : ${{ matrix.goversion }}
86- - name : Setup Node
87- uses : actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # tag=v6.0.0
88- with :
89- node-version : ${{matrix.nodeversion}}
90- registry-url : ${{env.NPM_REGISTRY_URL}}
91- - name : Setup DotNet
92- uses : actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # tag=v5.0.0
86+ - name : Install Pulumi Tools
87+ uses : ./.github/actions/pulumitools
9388 with :
9489 dotnet-version : ${{matrix.dotnetverson}}
95- - name : Setup Python
96- uses : actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # tag=v6.0.0
97- with :
90+ node-version : ${{matrix.nodeversion}}
9891 python-version : ${{matrix.pythonversion}}
9992 - name : Build SDK
10093 run : make build_${{ matrix.language }}
@@ -107,6 +100,9 @@ jobs:
107100 git diff
108101 exit 1
109102 fi
103+ - if : ${{ matrix.language == 'nodejs' }}
104+ name : Run type script unit tests
105+ run : make test_ts
110106 - if : ${{ matrix.language == 'python' && env.PUBLISH_PYPI == 'true' }}
111107 name : Publish package to PyPI
112108 uses : pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # tag=v1.13.0
@@ -118,7 +114,8 @@ jobs:
118114 uses : JS-DevTools/npm-publish@7f8fe47b3bea1be0c3aec2b717c5ec1f3e03410b # tag=v4.1.1
119115 with :
120116 access : " public"
121- token : ${{ env.NPM_TOKEN }}
117+ # old way, we want to use Trusted publishers
118+ # token: ${{ env.NPM_TOKEN }}
122119 package : ${{github.workspace}}/sdk/nodejs/bin/package.json
123120 provenance : true
124121 - if : ${{ matrix.language == 'dotnet' && env.PUBLISH_NUGET == 'true' }}
0 commit comments