Skip to content

chore: release main (#8677) #325

chore: release main (#8677)

chore: release main (#8677) #325

Workflow file for this run

name: 'Release'
# This workflow handles all release flows for the monorepo.
#
# Auto release (push to main):
# Release Please opens/updates a release PR with version bumps + changelog.
# When a maintainer merges that PR, the publish job ships every package to
# npm via OIDC trusted publishing, then the MCP registry publish chains.
#
# Manual dispatch:
# - mode = snapshot → bump to 0.0.0-<sha>, publish to npm dist-tag `dev`. Any branch.
# - mode = publish-only → publish current packages/*/package.json versions as-is.
# Recovery for a stable release whose publish job died after
# Release Please created the tag. Restricted to main.
on:
push:
branches: [main]
workflow_dispatch:
inputs:
mode:
type: choice
description: 'What to publish'
options:
- snapshot
- publish-only
default: snapshot
permissions: {}
jobs:
release-please:
if: github.event_name == 'push'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: write
outputs:
releases_created: ${{ steps.rp.outputs.releases_created }}
tag_name: ${{ steps.rp.outputs.tag_name }}
steps:
- uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
id: rp
with:
token: ${{ secrets.GITHUB_TOKEN }}
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
publish:
needs: release-please
if: needs.release-please.outputs.releases_created == 'true'
runs-on: ubuntu-latest
environment:
name: 'npm'
url: 'https://www.npmjs.com/package/@ui5/webcomponents-react'
permissions:
contents: write
id-token: write
issues: write
pull-requests: write
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
fetch-depth: 0
- name: Setup Node.js environment
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Install
run: |
npm install -g npm
yarn install --immutable
- name: build
run: yarn build
- name: build mcp-server data
run: yarn build:mcp
- name: publish to npm
run: ${GITHUB_WORKSPACE}/node_modules/.bin/lerna publish from-package --yes
env:
NPM_CONFIG_PROVENANCE: true
- name: Add release comments to issues and PRs
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { default: addIssueComments } = await import('${{ github.workspace }}/.github/createIssueCommentsForRelease.mjs');
await addIssueComments({ github, context })
snapshot:
if: github.event_name == 'workflow_dispatch' && inputs.mode == 'snapshot'
runs-on: ubuntu-latest
environment:
name: 'npm'
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
fetch-depth: 0
- name: Setup Node.js environment
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Install
run: |
npm install -g npm
yarn install --immutable
# Mutates package.json in the runner only; no commit, no tag — snapshot is ephemeral.
- name: version - Snapshot
run: |
git_hash=$(git rev-parse --short "${{ github.sha }}")
${GITHUB_WORKSPACE}/node_modules/.bin/lerna version "0.0.0-${git_hash}" \
--exact \
--no-push \
--no-git-tag-version \
--yes \
--allow-branch ${{ github.ref_name }}
- name: build
run: yarn build
- name: build mcp-server data
run: yarn build:mcp
- name: publish to npm
run: ${GITHUB_WORKSPACE}/node_modules/.bin/lerna publish from-package --yes --dist-tag dev
env:
NPM_CONFIG_PROVENANCE: true
publish-only:
if: github.event_name == 'workflow_dispatch' && inputs.mode == 'publish-only' && github.ref_name == 'main'
runs-on: ubuntu-latest
environment:
name: 'npm'
url: 'https://www.npmjs.com/package/@ui5/webcomponents-react'
permissions:
contents: write
id-token: write
issues: write
pull-requests: write
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
fetch-depth: 0
- name: Setup Node.js environment
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Install
run: |
npm install -g npm
yarn install --immutable
- name: build
run: yarn build
- name: build mcp-server data
run: yarn build:mcp
- name: publish to npm
run: ${GITHUB_WORKSPACE}/node_modules/.bin/lerna publish from-package --yes
env:
NPM_CONFIG_PROVENANCE: true
- name: Add release comments to issues and PRs
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { default: addIssueComments } = await import('${{ github.workspace }}/.github/createIssueCommentsForRelease.mjs');
await addIssueComments({ github, context })
# snapshots intentionally excluded (not main; no production release).
publish-mcp-registry:
needs: [publish, publish-only]
if: |
always() && github.ref_name == 'main' &&
(needs.publish.result == 'success' || needs.publish-only.result == 'success')
uses: './.github/workflows/publish-mcp-registry.yml'
permissions:
id-token: write
contents: read