Skip to content

Commit 6426756

Browse files
authored
fix: semantic release failure for older version mentioned (#286)
* fix: semantic release failure fix for older version Signed-off-by: Sridhar G K <gksridhar09@gmail.com> * chore: pre release validation Signed-off-by: Sridhar G K <gksridhar09@gmail.com> --------- Signed-off-by: Sridhar G K <gksridhar09@gmail.com>
1 parent bafda6a commit 6426756

File tree

6 files changed

+35
-11
lines changed

6 files changed

+35
-11
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.51.5
2+
current_version = 0.51.15
33
commit = True
44
message = Update version {current_version} -> {new_version} [skip ci]
55

.github/workflows/build-release.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,35 @@ jobs:
8888
pip install bump2version
8989
npm ci
9090
91+
- name: Validate version consistency
92+
run: |
93+
echo "=== Checking version consistency across files ==="
94+
95+
# Extract versions from each file
96+
VERSION_GO=$(grep -oP 'const Version = "\K[^"]+' common/version.go)
97+
VERSION_CFG=$(grep -oP 'current_version = \K.*' .bumpversion.cfg)
98+
VERSION_README_TITLE=$(grep -oP 'IBM Cloud Networking Go SDK Version \K[0-9.]+' README.md | head -1)
99+
VERSION_README_CURRENT=$(grep -oP 'The current version of this SDK: \K[0-9.]+' README.md)
100+
VERSION_README_GOPKG=$(grep -oP 'version = "\K[^"]+' README.md | head -1)
101+
102+
echo "common/version.go: $VERSION_GO"
103+
echo ".bumpversion.cfg: $VERSION_CFG"
104+
echo "README.md (title): $VERSION_README_TITLE"
105+
echo "README.md (current): $VERSION_README_CURRENT"
106+
echo "README.md (Gopkg): $VERSION_README_GOPKG"
107+
108+
# Check if all versions match
109+
if [ "$VERSION_GO" != "$VERSION_CFG" ] || \
110+
[ "$VERSION_GO" != "$VERSION_README_TITLE" ] || \
111+
[ "$VERSION_GO" != "$VERSION_README_CURRENT" ] || \
112+
[ "$VERSION_GO" != "$VERSION_README_GOPKG" ]; then
113+
echo "❌ ERROR: Version mismatch detected!"
114+
echo "All version strings must match before release."
115+
exit 1
116+
fi
117+
118+
echo "✅ All version strings match: $VERSION_GO"
119+
91120
- name: Run semantic-release
92121
env:
93122
GH_TOKEN: ${{ secrets.GH_TOKEN }}

.releaserc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
[
1414
"@semantic-release/git",
1515
{
16-
"assets": ["package.json", "common/version.go", "README.md", "CHANGELOG.md"],
16+
"assets": ["package.json", "common/version.go", "README.md", "CHANGELOG.md", ".bumpversion.cfg"],
1717
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}",
1818
"author": {
1919
"name": "IBM",

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
55
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
66

7-
# IBM Cloud Networking Go SDK Version 0.51.5
7+
# IBM Cloud Networking Go SDK Version 0.51.15
88

99
Go client library to interact with the various [IBM Cloud Networking Service APIs](https://cloud.ibm.com/apidocs?category=<networking>).
1010

@@ -89,7 +89,7 @@ The IBM Cloud Networking Go SDK allows developers to programmatically interact w
8989

9090
## Installation
9191

92-
The current version of this SDK: 0.51.5
92+
The current version of this SDK: 0.51.15
9393

9494
There are a few different ways to download and install the Networking Go SDK project for use by your
9595
Go application:
@@ -159,7 +159,7 @@ to your `Gopkg.toml` file. Here is an example:
159159
```
160160
[[constraint]]
161161
name = "github.com/IBM/networking-go-sdk"
162-
version = "0.51.5"
162+
version = "0.51.15"
163163
164164
```
165165

common/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
package common
1818

1919
// Version of the SDK
20-
const Version = "0.51.5"
20+
const Version = "0.51.15"

package-lock.json

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)