Skip to content

Commit 5f6f20c

Browse files
authored
ci(release-please): Release please single PR (#1176)
JIRA: CPOUI5FOUNDATION-1142 JIRA: CPOUI5FOUNDATION-1164 This change modifies several things, so the whole workflow can be complete: - Creates a Release Please process - Adds release please configuration and pipeline - Releases the all of the package at once with a single PR - Generates an `npm-shrinkwrap.json` for the CLI package before being released (out of monorepo's root `package-lock.json`) - Introduce a new package `shrinkwrap-extractor` to deal with `@ui5/cli`'s `npm-shrinkwrap.json` generation in a monorepository environment - Clear separation between "public" and "internal" packages - Adjusts pipelines to deal with the new structure: - github-ci.yml - reuse-compliance.yml - Adjust `deploy-vitepress-docs.yaml` so that it will generate API documentation out of published NPM packages and not from the packages within the monorepo - Align `package.json` scripts, so that they can be easily (re)used within the monorepo structure.
1 parent 78d312b commit 5f6f20c

File tree

79 files changed

+58261
-15057
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+58261
-15057
lines changed

.github/workflows/deploy-vitepress-docs.yaml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,23 @@ jobs:
4040
cache: npm
4141
- name: Setup Pages
4242
uses: actions/configure-pages@v4
43-
- name: Install dependencies
44-
run: npm ci --engine-strict # --engine-strict is used to fail-fast if deps require node versions unsupported by the repo
45-
- name: Install documentation dependencies
46-
working-directory: packages/documentation
47-
run: npm ci --engine-strict # --engine-strict is used to fail-fast if deps require node versions unsupported by the repo
43+
- name: Copy documentation package to isolated directory
44+
run: |
45+
# Create isolated directory for documentation
46+
# So, that API.json will be build from the NPM packages,
47+
# and not from workspace packages
48+
mkdir -p ${{ runner.temp }}/isolated-docs
49+
cp -r internal/documentation/. ${{ runner.temp }}/isolated-docs/
50+
- name: Install documentation dependencies from NPM
51+
working-directory: ${{ runner.temp }}/isolated-docs
52+
run: npm ci --engine-strict
4853
- name: Fetch gh-pages branch
4954
run: git fetch origin gh-pages --depth=1
5055
- name: generate CLI doc
51-
working-directory: packages/documentation
56+
working-directory: ${{ runner.temp }}/isolated-docs
5257
run: npm run generate-cli-doc
5358
- name: Build vitepress build
54-
working-directory: packages/documentation
59+
working-directory: ${{ runner.temp }}/isolated-docs
5560
run: |
5661
# The base output
5762
npm run build:vitepress -- --base="/${{ github.event.repository.name }}/${DOC_VERSION}/"
@@ -60,11 +65,10 @@ jobs:
6065
npm run build:vitepress -- --base="/${{ github.event.repository.name }}/${DOC_ALIAS}/" --outDir="dist-${DOC_ALIAS}"
6166
npm run build:assets -- ./dist-${DOC_ALIAS}
6267
- name: Build jsdoc
63-
working-directory: packages/documentation
68+
working-directory: ${{ runner.temp }}/isolated-docs
6469
run: npm run jsdoc-generate
6570
# TODO: Skip for now deployment of the schema until we do a Schema Version 5 release
66-
# - name: Build Schema
67-
# run: |
71+
# - name: Build Sch3 |
6872
# npm run schema-generate
6973
# npm run schema-workspace-generate
7074
- name: Checkout gh-pages
@@ -81,16 +85,16 @@ jobs:
8185
rm -rf ./gh-pages/${DOC_ALIAS}
8286
8387
# Main version route
84-
cp -R ./packages/documentation/dist ./gh-pages/${DOC_VERSION}/
88+
cp -R ${{ runner.temp }}/isolated-docs/dist ./gh-pages/${DOC_VERSION}/
8589
8690
# Alias route. E.g., next, latest, stable, etc.
8791
# For vitepress must be a copy with different config, not a symlink
88-
cp -R ./packages/documentation/dist-${DOC_ALIAS} ./gh-pages/${DOC_ALIAS}/
92+
cp -R ${{ runner.temp }}/isolated-docs/dist-${DOC_ALIAS} ./gh-pages/${DOC_ALIAS}/
8993
# Symlink the api docs to avoid duplication
9094
ln -s ../${DOC_VERSION}/api ./gh-pages/${DOC_ALIAS}/api
9195
9296
# TODO: Enable when v5 release is done
93-
# cp ./packages/documentation/scripts/resources/custom404.html ./gh-pages/404.html
97+
# cp ${{ runner.temp }}/isolated-docs/scripts/resources/custom404.html ./gh-pages/404.html
9498
- name: Publish Docs
9599
run: |
96100
cd ./gh-pages

.github/workflows/github-ci.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,16 @@ jobs:
4040
run: npm run unit
4141

4242
- name: Generate JSDoc documentation
43-
working-directory: packages/documentation
44-
run: |
45-
npm ci --engine-strict # --engine-strict is used to fail-fast if deps require node versions unsupported by the repo
46-
npm run jsdoc-generate
43+
working-directory: internal/documentation
44+
run: npm run jsdoc-generate
4745

4846
- name: Generate merged JSON schema
4947
run: npm run schema-generate
5048

5149
- name: Generate CLI documentation
52-
working-directory: packages/documentation
50+
working-directory: internal/documentation
5351
run: npm run generate-cli-doc
52+
53+
- name: Check shrinkwrap integrity
54+
working-directory: internal/shrinkwrap-extractor
55+
run: npm run test
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Release Please
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
id-token: write # Required for trusted publishing via OIDC (https://docs.npmjs.com/trusted-publishers)
12+
13+
jobs:
14+
release-please:
15+
runs-on: ubuntu-24.04
16+
steps:
17+
- uses: actions/checkout@v5
18+
19+
- name: Node.js LTS
20+
uses: actions/setup-node@v5
21+
with:
22+
node-version: 24.x
23+
24+
- name: Run Release Please to update PRs and create releases
25+
uses: googleapis/release-please-action@v4
26+
id: release
27+
with:
28+
token: "${{ secrets.GITHUB_TOKEN }}"
29+
30+
publish-packages:
31+
runs-on: ubuntu-24.04
32+
needs: release-please
33+
if: needs.release-please.outputs.releases_created == 'true'
34+
strategy:
35+
# Sequential publishing ensures dependencies exist on NPM before dependents are published
36+
# Order: logger → fs → builder → server → project (CLI handled separately for shrinkwrap generation)
37+
max-parallel: 1
38+
matrix:
39+
package: [logger, fs, builder, server, project]
40+
steps:
41+
- uses: actions/checkout@v5
42+
43+
- name: Node.js LTS
44+
uses: actions/setup-node@v5
45+
with:
46+
node-version: 24.x
47+
48+
- name: Install dependencies
49+
run: npm ci
50+
51+
- name: Publish ${{ matrix.package }} package
52+
working-directory: packages/${{ matrix.package }}
53+
run: |
54+
echo "🚀 Publishing @ui5/${{ matrix.package }}"
55+
56+
# TODO: Uncomment when ready to publish
57+
# npm publish --access public
58+
59+
publish-cli:
60+
runs-on: ubuntu-24.04
61+
needs: [release-please, publish-packages]
62+
if: needs.release-please.outputs.releases_created == 'true'
63+
steps:
64+
- uses: actions/checkout@v5
65+
66+
- name: Node.js LTS
67+
uses: actions/setup-node@v5
68+
with:
69+
node-version: 24.x
70+
71+
- name: Install dependencies
72+
run: npm ci
73+
74+
- name: Generate npm-shrinkwrap.json
75+
working-directory: packages/cli
76+
run: |
77+
set -e
78+
node ../../internal/shrinkwrap-extractor/cli.js ../../
79+
80+
- name: Publish @ui5/cli package
81+
working-directory: packages/cli
82+
run: |
83+
echo "🚀 Publishing @ui5/cli"
84+
# TODO: Uncomment when ready to publish
85+
# npm publish --access public

.github/workflows/reuse-compliance.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ jobs:
1818
strategy:
1919
matrix:
2020
package:
21+
- "internal/documentation"
22+
- "internal/shrinkwrap-extractor"
2123
- "packages/builder"
2224
- "packages/cli"
23-
- "packages/documentation"
2425
- "packages/fs"
2526
- "packages/logger"
2627
- "packages/project"

.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ site/
6363
!packages/**/test/fixtures/**/node_modules
6464

6565
# Documentation
66-
packages/documentation/docs/pages/CLI.md
67-
packages/documentation/.vitepress/dist
68-
packages/documentation/.vitepress/cache
69-
packages/documentation/dist
66+
internal/documentation/docs/pages/CLI.md
67+
internal/documentation/.vitepress/dist
68+
internal/documentation/.vitepress/cache
69+
internal/documentation/dist

.release-please-manifest.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"packages/logger": "4.0.2",
3+
"packages/fs": "4.0.2",
4+
"packages/builder": "4.0.11",
5+
"packages/server": "4.0.7",
6+
"packages/project": "4.0.6",
7+
"packages/cli": "4.0.26"
8+
}

README.md

Lines changed: 1 addition & 1 deletion

eslint.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ export default [
66
// to add to common config
77
ignores: [
88
"**/site/",
9-
"packages/"
9+
"packages/",
10+
"internal/"
1011
]
1112
},
1213
...eslintCommonConfig, // Load common ESLint config

0 commit comments

Comments
 (0)