Skip to content

Commit

Permalink
Add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
acomagu committed Jul 31, 2024
1 parent bb61344 commit a956c67
Showing 1 changed file with 108 additions and 0 deletions.
108 changes: 108 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:
jobs:
release_npm:
name: Publish to npm
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
- run: npm ci
- run: npx jsii-pacmak -v --target js
- run: npx publib-npm
env:
NPM_DIST_TAG: latest
NPM_REGISTRY: registry.npmjs.org
NPM_CONFIG_PROVENANCE: "true"
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
release_maven:
name: Publish to Maven Central
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: corretto
java-version: "11"
- uses: actions/setup-node@v4
with:
node-version: 20.x
- run: npm ci
- run: npx jsii-pacmak -v --target java
- run: npx publib-maven
env:
MAVEN_ENDPOINT: https://s01.oss.sonatype.org
MAVEN_GPG_PRIVATE_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
MAVEN_GPG_PRIVATE_KEY_PASSPHRASE: ${{ secrets.MAVEN_GPG_PRIVATE_KEY_PASSPHRASE }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_STAGING_PROFILE_ID: ${{ secrets.MAVEN_STAGING_PROFILE_ID }}
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
release_pypi:
name: Publish to PyPI
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: npm ci
- run: npx jsii-pacmak -v --target python
- run: npx publib-pypi
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
release_nuget:
name: Publish to NuGet Gallery
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.x
- run: npm ci
- run: npx jsii-pacmak -v --target dotnet
- run: npx publib-nuget
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
release_golang:
name: Publish to GitHub Go Module Repository
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
- uses: actions/setup-go@v5
with:
go-version: ^1.18.0
- run: npm ci
- run: npx jsii-pacmak -v --target go
- run: npx publib-golang
env:
GIT_USER_NAME: cdklabs-automation
GIT_USER_EMAIL: cdklabs-automation@amazon.com
GITHUB_TOKEN: ${{ secrets.GO_GITHUB_TOKEN }}

0 comments on commit a956c67

Please sign in to comment.