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
2419 PUBLISH_NPM : true
25- PUBLISH_NUGET : true
20+ # NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }}
21+ # NUGET_FEED_URL: https://api.nuget.org/v3/index.json
22+ # PULUMI_LOCAL_NUGET: ${{ github.workspace }}/nuget
23+ # PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
24+ # PYPI_USERNAME: "__token__"
25+ # PUBLISH_PYPI: true
26+ # PUBLISH_NUGET: true
2627jobs :
2728 publish_binary :
2829 name : publish
2930 runs-on : ubuntu-latest
3031 steps :
32+ # TODO: remove when this repo is made public
33+ - name : Configure Git for Private Modules
34+ run : |
35+ git config --global url."https://oauth2:${{ secrets.PR_TOKEN }}@github.com".insteadOf "https://github.com"
36+ # Sets GOPRIVATE and GONOSUMDB in order to use the git authetnication for go mod.
37+ echo "GOPRIVATE=github.com/${{ github.repository }}/*,github.com/stackitcloud/*" >> $GITHUB_ENV
38+ echo "GONOSUMDB=github.com/${{ github.repository }}/*,github.com/stackitcloud/*" >> $GITHUB_ENV
39+ # TODO: remove end
3140 - name : Checkout Repo
3241 uses : actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # tag=v4.2.2
42+ with :
43+ fetch-depth : 0
3344 - name : Unshallow clone for tags
3445 run : git fetch --prune --unshallow --tags
3546 - name : Install pulumictl
4455 run : echo "GORELEASER_CURRENT_TAG=v$(pulumictl get version --language generic)" >> $GITHUB_ENV
4556 - uses : sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad # v4.0.0
4657 - uses : anchore/sbom-action/download-syft@fbfd9c6c189226748411491745178e0c2017392d # v0.20.10
58+ - name : Debugging what was changed
59+ run : |
60+ git status
61+ git diff
62+ git tag -n
4763 - name : Run GoReleaser
4864 uses : goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # tag=v6.3.0
4965 with :
6985 runs-on : ubuntu-latest
7086 needs : publish_binary
7187 steps :
88+ # TODO: remove when this repo is made public
89+ - name : Configure Git for Private Modules
90+ run : |
91+ git config --global url."https://oauth2:${{ secrets.PR_TOKEN }}@github.com".insteadOf "https://github.com"
92+ # Sets GOPRIVATE and GONOSUMDB in order to use the git authetnication for go mod.
93+ echo "GOPRIVATE=github.com/${{ github.repository }}/*,github.com/stackitcloud/*" >> $GITHUB_ENV
94+ echo "GONOSUMDB=github.com/${{ github.repository }}/*,github.com/stackitcloud/*" >> $GITHUB_ENV
95+ # TODO: remove end
7296 - name : Checkout Repo
7397 uses : actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # tag=v4.2.2
7498 - name : Unshallow clone for tags
87111 uses : actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # tag=v6.0.0
88112 with :
89113 node-version : ${{matrix.nodeversion}}
90- registry-url : ${{env.NPM_REGISTRY_URL}}
114+ # registry-url: ${{env.NPM_REGISTRY_URL}}
91115 - name : Setup DotNet
92116 uses : actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # tag=v5.0.0
93117 with :
@@ -107,6 +131,8 @@ jobs:
107131 git diff
108132 exit 1
109133 fi
134+ - name : Run all unit tests
135+ run : make test
110136 - if : ${{ matrix.language == 'python' && env.PUBLISH_PYPI == 'true' }}
111137 name : Publish package to PyPI
112138 uses : pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # tag=v1.13.0
@@ -117,8 +143,9 @@ jobs:
117143 - if : ${{ matrix.language == 'nodejs' && env.PUBLISH_NPM == 'true' }}
118144 uses : JS-DevTools/npm-publish@7f8fe47b3bea1be0c3aec2b717c5ec1f3e03410b # tag=v4.1.1
119145 with :
120- access : " public"
121- token : ${{ env.NPM_TOKEN }}
146+ access : " private"
147+ # token: ${{ env.NPM_TOKEN }}
148+ token : ${{ secrets.PR_TOKEN }}
122149 package : ${{github.workspace}}/sdk/nodejs/bin/package.json
123150 provenance : true
124151 - if : ${{ matrix.language == 'dotnet' && env.PUBLISH_NUGET == 'true' }}
0 commit comments