Release #215
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: | |
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 | |
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 | |
build-and-release: | |
needs: ['test', 'release-dryrun'] | |
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 | |
yarn build | |
- name: publish | |
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 publish ${{ github.event.inputs.release_type }} \ | |
${{ (github.event.inputs.prerelease == 'true' && '--conventional-prerelease') || '--conventional-graduate' }} \ | |
--create-release github | |
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 }) | |