Skip to content

Commit c8508c8

Browse files
committed
Add release workflow
1 parent bb61344 commit c8508c8

File tree

1 file changed

+104
-0
lines changed

1 file changed

+104
-0
lines changed

.github/workflows/release.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: release
2+
on:
3+
push:
4+
branches:
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+'
7+
workflow_dispatch:
8+
jobs:
9+
release_npm:
10+
name: Publish to npm
11+
runs-on: ubuntu-latest
12+
permissions:
13+
id-token: write
14+
contents: read
15+
steps:
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: 20.x
19+
- run: npm ci
20+
- run: npx jsii-pacmak -v --target js
21+
- run: npx publib-npm
22+
env:
23+
NPM_DIST_TAG: latest
24+
NPM_REGISTRY: registry.npmjs.org
25+
NPM_CONFIG_PROVENANCE: "true"
26+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
27+
release_maven:
28+
name: Publish to Maven Central
29+
runs-on: ubuntu-latest
30+
permissions:
31+
contents: read
32+
steps:
33+
- uses: actions/setup-java@v4
34+
with:
35+
distribution: corretto
36+
java-version: "11"
37+
- uses: actions/setup-node@v4
38+
with:
39+
node-version: 20.x
40+
- run: npm ci
41+
- run: npx jsii-pacmak -v --target js
42+
- run: npx publib-maven
43+
env:
44+
MAVEN_ENDPOINT: https://s01.oss.sonatype.org
45+
MAVEN_GPG_PRIVATE_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
46+
MAVEN_GPG_PRIVATE_KEY_PASSPHRASE: ${{ secrets.MAVEN_GPG_PRIVATE_KEY_PASSPHRASE }}
47+
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
48+
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
49+
MAVEN_STAGING_PROFILE_ID: ${{ secrets.MAVEN_STAGING_PROFILE_ID }}
50+
MAVEN_OPTS: --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED
51+
release_pypi:
52+
name: Publish to PyPI
53+
runs-on: ubuntu-latest
54+
permissions:
55+
contents: read
56+
steps:
57+
- uses: actions/setup-node@v4
58+
with:
59+
node-version: 20.x
60+
- uses: actions/setup-python@v5
61+
with:
62+
python-version: 3.x
63+
- run: npm ci
64+
- run: npx jsii-pacmak -v --target js
65+
- run: npx publib-pypi
66+
env:
67+
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
68+
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
69+
release_nuget:
70+
name: Publish to NuGet Gallery
71+
runs-on: ubuntu-latest
72+
permissions:
73+
contents: read
74+
steps:
75+
- uses: actions/setup-node@v4
76+
with:
77+
node-version: 20.x
78+
- uses: actions/setup-dotnet@v4
79+
with:
80+
dotnet-version: 6.x
81+
- run: npm ci
82+
- run: npx jsii-pacmak -v --target js
83+
- run: npx publib-nuget
84+
env:
85+
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
86+
release_golang:
87+
name: Publish to GitHub Go Module Repository
88+
runs-on: ubuntu-latest
89+
permissions:
90+
contents: read
91+
steps:
92+
- uses: actions/setup-node@v4
93+
with:
94+
node-version: 20.x
95+
- uses: actions/setup-go@v5
96+
with:
97+
go-version: ^1.18.0
98+
- run: npm ci
99+
- run: npx jsii-pacmak -v --target js
100+
- run: npx publib-golang
101+
env:
102+
GIT_USER_NAME: cdklabs-automation
103+
GIT_USER_EMAIL: [email protected]
104+
GITHUB_TOKEN: ${{ secrets.GO_GITHUB_TOKEN }}

0 commit comments

Comments
 (0)