Skip to content

Release

Release #236

Workflow file for this run

name: 'Release'
on:
workflow_dispatch:
inputs:
release_type:
type: string
description: 'Release Type: Lerna Auto Versioning if empty.'
required: false
default: ''
prerelease:
type: boolean
description: 'pre-release'
required: false
default: false
jobs:
test:
uses: './.github/workflows/test.yml'
with:
reportCoverage: false
check-charts-compat-peer-deps:
runs-on: ubuntu-latest
environment: charts-peer-deps-approval
steps:
- name: No-op
run: echo "Did you update the peer dependencies of the charts and compat package?"
release-dryrun:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Install
run: |
npm install -g npm
yarn install --immutable
- name: version
run: |
${GITHUB_WORKSPACE}/node_modules/.bin/lerna version ${{ github.event.inputs.release_type }} \
${{ (github.event.inputs.prerelease == 'true' && '--conventional-prerelease') || '--conventional-graduate' }} \
--no-git-tag-version --no-push --force-publish
build-and-release:
needs: ['test', 'release-dryrun', 'check-charts-compat-peer-deps']
runs-on: ubuntu-latest
environment:
name: 'npm'
url: 'https://www.npmjs.com/package/@ui5/webcomponents-react'
permissions:
contents: write
id-token: write
issues: write
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.ACCESS_TOKEN }}
fetch-depth: 0
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Install and build
run: |
npm install -g npm
yarn install --immutable
- name: version
run: |
npm config set //registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}
git config user.email ${{ secrets.BOT_GIT_EMAIL }}
git config user.name ${{ secrets.BOT_GIT_USERNAME }}
${GITHUB_WORKSPACE}/node_modules/.bin/lerna version ${{ github.event.inputs.release_type }} \
${{ (github.event.inputs.prerelease == 'true' && '--conventional-prerelease') || '--conventional-graduate' }} \
--create-release github --force-publish
env:
GH_TOKEN: ${{ secrets.ACCESS_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
NPM_CONFIG_PROVENANCE: true
- name: build
run: yarn build
- name: publish to npm
run: ${GITHUB_WORKSPACE}/node_modules/.bin/lerna publish from-git
env:
GH_TOKEN: ${{ secrets.ACCESS_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
NPM_CONFIG_PROVENANCE: true
### Semantic Release Bot comments for issues and PRs ###
- name: Add release comments to issues and PRs
uses: actions/github-script@v7
env:
GH_TOKEN: ${{ secrets.ACCESS_TOKEN }}
with:
github-token: ${{ secrets.ACCESS_TOKEN }}
script: |
const { default: addIssueComments } = await import('${{ github.workspace }}/.github/createIssueCommentsForRelease.mjs');
await addIssueComments({ github, context })