Skip to content
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Release Please

on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
release-please:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5

- name: Node.js LTS
uses: actions/setup-node@v5
with:
node-version: 24.x

- name: Run Release Please to update PRs and create releases
uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}

publish-packages:
runs-on: ubuntu-24.04
needs: release-please
if: needs.release-please.outputs.releases_created == 'true'
strategy:
# Publish packages in dependency order: logger → fs → builder → server → project
# CLI is handled separately to update shrinkwrap
# Order of packages in the matrix does matter and is important!
# release-please updates the package.json dependencies with ones that do not exist yet on NPM
# Publish in the correct order is important, so that dependencies are available and resolved properly!
max-parallel: 1
matrix:
package: [logger, fs, builder, server, project]
steps:
- uses: actions/checkout@v5

- name: Node.js LTS
uses: actions/setup-node@v5
with:
node-version: 24.x

- name: Install and publish ${{ matrix.package }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Special handling for the CLI package is required, where the shrinkwrap needs to be updated/created after all dependencies have been released. Should this be done in a separate PR?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!
I think we had something related to the shrinkwrap itself, but I can't find the discussion/BLI!

I have updated the action so that it:

  • Runs the publishing of all the packages in a sequence. This ensures that during npm ci for publishing for the next package in the chain, it will have the previous package already published on NPM.
  • For the CLI, it has a special step where all the packages are available already on NPM and it's been updated accordingly.

As per my research this is the approach many monorepos are wokring. Lerna, for example

run: |
cd packages/${{ matrix.package }}
echo "🚀 Publishing @ui5/${{ matrix.package }}"

# TODO: Uncomment when ready to publish
# npm ci
# npm publish --access public

publish-cli:
runs-on: ubuntu-24.04
needs: [release-please, publish-packages]
if: needs.release-please.outputs.releases_created == 'true'
steps:
- uses: actions/checkout@v5

- name: Node.js LTS
uses: actions/setup-node@v5
with:
node-version: 24.x

- name: Update CLI shrinkwrap and publish
run: |
cd packages/cli
echo "🔄 Updating npm-shrinkwrap.json for CLI"

rm -f npm-shrinkwrap.json
npm install --package-lock-only
npm shrinkwrap

echo "🚀 Publishing @ui5/cli"

# TODO: Uncomment when ready to publish
# npm ci
# npm publish --access public
8 changes: 8 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"packages/logger": "4.0.2",
"packages/fs": "4.0.2",
"packages/builder": "4.0.11",
"packages/server": "4.0.7",
"packages/project": "4.0.6",
"packages/cli": "4.0.26"
}
94 changes: 94 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"include-component-in-tag": false,
"group-pull-request-title-pattern": "release: UI5 CLI packages",
"packages": {
"packages/logger": {
"component": "logger"
},
"packages/fs": {
"component": "fs"
},
"packages/builder": {
"component": "builder"
},
"packages/server": {
"component": "server"
},
"packages/project": {
"component": "project"
},
"packages/cli": {
"component": "cli",
"extra-files": [
"npm-shrinkwrap.json"
]
}
},
"release-type": "node",
"always-update": true,
"pull-request-header": ":tractor: New release prepared",
"pull-request-title-pattern": "release: UI5 CLI packages",
"plugins": [
{
"type": "node-workspace"
}
],
"changelog-sections": [
{
"type": "feat",
"section": "Features"
},
{
"type": "fix",
"section": "Bug Fixes"
},
{
"type": "perf",
"section": "Performance Improvements"
},
{
"type": "deps",
"section": "Dependencies"
},
{
"type": "revert",
"section": "Reverts"
},
{
"type": "docs",
"section": "Documentation",
"hidden": true
},
{
"type": "style",
"section": "Styles",
"hidden": true
},
{
"type": "refactor",
"section": "Code Refactoring",
"hidden": true
},
{
"type": "test",
"section": "Tests",
"hidden": true
},
{
"type": "build",
"section": "Automation",
"hidden": true
},
{
"type": "ci",
"section": "Continuous Integration",
"hidden": true
},
{
"type": "release",
"section": "Release",
"hidden": true
}
]
}