release #53
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'src/**' | |
- package.json | |
- API.md | |
workflow_dispatch: {} | |
env: | |
CI: "true" | |
jobs: | |
release_github: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set git identity | |
run: |- | |
git config user.name "github-actions" | |
git config user.email "[email protected]" | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install Zig toolchain | |
uses: korandoru/setup-zig@v1 | |
with: | |
zig-version: 0.13.0 | |
- name: Install Cargo Lambda | |
uses: jaxxstorm/[email protected] | |
with: | |
repo: cargo-lambda/cargo-lambda | |
tag: v1.5.0 | |
platform: linux | |
arch: x86_64 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '7.x' | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: '1.x' | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: '17.x' | |
distribution: 'temurin' | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12.3 | |
- name: Install NPM dependencies | |
run: npx projen install:ci | |
- name: Build | |
run: npx projen build --verbose | |
- name: Release | |
run: npx projen release | |
- name: Release GitHub | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_REPOSITORY: ${{ github.repository }} | |
GITHUB_REF: ${{ github.ref }} | |
run: errout=$(mktemp); gh release create $(cat dist/releasetag.txt) -R $GITHUB_REPOSITORY -F dist/changelog.md -t $(cat dist/releasetag.txt) --target $GITHUB_REF 2> $errout && true; exitcode=$?; if [ $exitcode -ne 0 ] && ! grep -q "Release.tag_name already exists" $errout; then cat $errout; exit $exitcode; fi | |
- name: Release JS Artifact | |
env: | |
NPM_DIST_TAG: latest | |
NPM_REGISTRY: registry.npmjs.org | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: npx -p publib@latest publib-npm | |
- name: Release Java Artifact | |
env: | |
MAVEN_SERVER_ID: 'github' | |
MAVEN_REPOSITORY_URL: 'https://maven.pkg.github.com/cargo-lambda/cargo-lambda-cdk' | |
MAVEN_ENDPOINT: 'https://maven.pkg.github.com' | |
MAVEN_USERNAME: ${{ github.actor }} | |
MAVEN_PASSWORD: ${{ secrets.CDK_PACKAGES_REGISTRY_GITHUB_TOKEN }} | |
run: npx -p publib@latest publib-maven | |
- name: Release Python Artifact | |
env: | |
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} | |
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} | |
run: npx -p publib@latest publib-pypi | |
- name: Release Dotnet Artifact | |
env: | |
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | |
run: npx -p publib@latest publib-nuget | |
- name: Release Go Artifact | |
env: | |
GIT_USER_NAME: github-actions | |
GIT_USER_EMAIL: [email protected] | |
GITHUB_TOKEN: ${{ secrets.CDK_PACKAGES_REGISTRY_GITHUB_TOKEN }} | |
run: npx -p publib@latest publib-golang |