Skip to content

Commit 135480a

Browse files
authored
ci: update versioning in release-please config (openscd#1678)
* ci: add extra-files configuration for manifest.json version * doc: add information about automated releases
1 parent c850088 commit 135480a

File tree

2 files changed

+60
-3
lines changed

2 files changed

+60
-3
lines changed

docs/how-to/release.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Release Process
2+
3+
This document outlines the steps involved in the release process for the OpenSCD project.
4+
5+
## Automated Release Workflow
6+
7+
The release process is automated using GitHub Actions and the `release-please` workflow. Below is an overview of the steps:
8+
9+
1. **Triggering the Workflow**:
10+
- The workflow is triggered on a push to the `main` branch.
11+
12+
2. **Release Creation**:
13+
- The `googleapis/release-please-action` is used to create a new release. It determines the version bump (major, minor, or patch) based on conventional commits.
14+
15+
3. **NPM Publication**:
16+
- When a release is created, the `packages/core` package is published to the NPM registry.
17+
18+
4. **Build Assets**:
19+
- The workflow creates zipped and tarred build assets from the `packages/distribution/build/`, that are attached to the GitHub release.
20+
21+
## Manual Steps - Verify the Release
22+
- After the workflow completes, a pull request (PR) is automatically opened with the relevant changes.
23+
- Review the PR to ensure the correct version and assets are included.
24+
- Once verified, merge the PR to finalise the release.
25+
26+
## Notes
27+
28+
- The release process relies on conventional commits to determine versioning. Ensure commit messages follow the [Conventional Commits](https://www.conventionalcommits.org/) specification or read more [here](./commiting.md).
29+
30+
## Versioning Strategy
31+
32+
- The version in the root `package.json` represents the official release version of the distribution. This version is also reflected in `packages/distribution/manifest.json`.
33+
- The version in `packages/core/package.json` is used to publish the `core` package to the NPM registry.
34+
- The version in `packages/openscd/package.json` is used to manage the versioning of the `openscd` package.
35+
- These versions are updated automatically by the `release-please` action during the release process. Version numbers are updated automatically based on conventional commits.
36+

release-please-config.json

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,14 @@
6060
"initial-version": "0.33.0",
6161
"include-component-in-tag": true,
6262
"include-v-in-tag": true,
63-
"tag-separator": "@"
63+
"tag-separator": "@",
64+
"extra-files": [
65+
{
66+
"type": "json",
67+
"path": "packages/openscd/package.json",
68+
"jsonpath": "$.version"
69+
}
70+
]
6471
},
6572
"packages/core": {
6673
"component": "core",
@@ -73,10 +80,24 @@
7380
"initial-version": "0.1.0",
7481
"include-component-in-tag": true,
7582
"include-v-in-tag": true,
76-
"tag-separator": "@"
83+
"tag-separator": "@",
84+
"extra-files": [
85+
{
86+
"type": "json",
87+
"path": "packages/core/package.json",
88+
"jsonpath": "$.version"
89+
}
90+
]
7791
}
7892
},
7993
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
8094
"bootstrap-sha": "e780fb7605cd828740492061a26d3fca21275976",
81-
"release-type": "node"
95+
"release-type": "node",
96+
"extra-files": [
97+
{
98+
"type": "json",
99+
"path": "packages/distribution/manifest.json",
100+
"jsonpath": "$.version"
101+
}
102+
]
82103
}

0 commit comments

Comments
 (0)