Skip to content

Commit 1db923f

Browse files
committed
chore(release): Add release pipeline for TypeScript
Signed-off-by: Alexander Dahmen <[email protected]>
1 parent f0099ec commit 1db923f

File tree

4 files changed

+71
-45
lines changed

4 files changed

+71
-45
lines changed

.github/workflows/release.yaml

Lines changed: 39 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,38 @@ on:
88
permissions:
99
contents: write
1010
id-token: write
11+
packages: write
1112

1213
env:
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
2628
jobs:
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 authentication 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
32-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # tag=v4.2.2
42+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # tag=v4.2.2
3343
- name: Unshallow clone for tags
3444
run: git fetch --prune --unshallow --tags
3545
- name: Install pulumictl
@@ -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 authentication 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
73-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # tag=v4.2.2
79+
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@395ad3262231945c25e8478fd5baf05154b1d79f # tag=v6.1.0
88-
with:
89-
node-version: ${{matrix.nodeversion}}
90-
registry-url: ${{env.NPM_REGISTRY_URL}}
91-
- name: Setup DotNet
92-
uses: actions/setup-dotnet@2016bd2012dba4e32de620c46fe006a3ac9f0602 # tag=v5.0.1
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@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # tag=v6.1.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' }}

.goreleaser.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,14 @@ signs:
2727
- cmd: cosign
2828
env:
2929
- COSIGN_EXPERIMENTAL=1
30-
certificate: '${artifact}.pem'
30+
signature: '${artifact}.sig'
3131
args:
3232
- sign-blob
3333
- '-y'
34-
- '--output-certificate=${certificate}'
34+
- "--output-signature=${signature}"
3535
- '--bundle=${signature}'
3636
- '${artifact}'
3737
artifacts: all
38-
output: true
3938

4039
sboms:
4140
- artifacts: archive

RELEASE.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Release
2+
3+
## Release cycle
4+
5+
Upstream terraform provider: [terraform-provider-stackit](https://github.com/stackitcloud/terraform-provider-stackit)
6+
7+
This Pulumi provider will be updated as fast as possible to keep the delta between the Pulumi Bridge and the upstream Terraform provider small.
8+
The release cycle of the Terraform provider is about every two weeks. Depending on the adjustments made it will take some time
9+
to update the Pulumi provider as well. Examples needs to be added/adjusted, Unit tests and acceptance tests have to be added or adjusted accordingly.
10+
11+
The version of the Pulumi provider is the same as the one for the Terraform provider e.g. if the latest version of the Terraform provider is
12+
v0.70.0 the there will be a corresponding Pulumi version with v0.70.0.
13+
14+
15+
## Release creation
16+
17+
> [!IMPORTANT]
18+
> Consider informing / syncing with the team before creating a new release.
19+
20+
1. Check out latest main branch on your machine
21+
2. Create the following git tags:
22+
- `VERSION="vX.X.X"; git tag "$VERSION" && git tag "provider/pkg/version/$VERSION" && git tag "provider/shim/$VERSION"`
23+
3. Push the git tag: `git push origin --tags`
24+
4. The [release pipeline](https://github.com/stackitcloud/pulumi-stackit/actions/workflows/release.yaml) will build the release and publish it on GitHub
25+
5. Ensure the release was created properly using the
26+
- [GitHub releases page](https://github.com/stackitcloud/pulumi-stackit/releases)
27+
- [Pulumi registry](https://www.pulumi.com/registry/packages)
28+
6. Ensure the packages where properly published (e.g. to npm)
29+
- [npm](https://www.npmjs.com/)

go.work.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,7 @@ golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
523523
golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
524524
golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
525525
golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
526+
golang.org/x/telemetry v0.0.0-20250908211612-aef8a434d053 h1:dHQOQddU4YHS5gY33/6klKjq7Gp3WwMyOXGNp5nzRj8=
526527
golang.org/x/telemetry v0.0.0-20250908211612-aef8a434d053/go.mod h1:+nZKN+XVh4LCiA9DV3ywrzN4gumyCnKjau3NGb9SGoE=
527528
golang.org/x/telemetry v0.0.0-20251008203120-078029d740a8 h1:LvzTn0GQhWuvKH/kVRS3R3bVAsdQWI7hvfLHGgh9+lU=
528529
golang.org/x/telemetry v0.0.0-20251008203120-078029d740a8/go.mod h1:Pi4ztBfryZoJEkyFTI5/Ocsu2jXyDr6iSdgJiYE/uwE=

0 commit comments

Comments
 (0)