Skip to content

Commit ecc8f8e

Browse files
committed
Bump docs to 1.0.1 and add release docs step
Replace 1.0.1-SNAPSHOT with the released 1.0.1 across README.md and docs, and add a CI step to the release workflow that extracts the release version (stripping a leading 'v'), updates version references in the docs, commits, and pushes changes before creating the GitHub release. The workflow updates README.md and the getting-started/guides markdown files by replacing semver or semver-SNAPSHOT patterns with the released version.
1 parent eef092c commit ecc8f8e

5 files changed

Lines changed: 36 additions & 9 deletions

File tree

.github/workflows/release.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,33 @@ jobs:
4747
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
4848
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
4949

50+
- name: Update docs with released version
51+
run: |
52+
VERSION=$(grep '^scm.tag=' release.properties | cut -d'=' -f2)
53+
# Strip leading 'v' if present (e.g., v1.0.1 -> 1.0.1)
54+
RELEASE_VERSION="${VERSION#v}"
55+
56+
FILES=(
57+
README.md
58+
docs/docs/getting-started/installation.md
59+
docs/docs/guides/resolvers.md
60+
docs/docs/guides/spring-boot.md
61+
)
62+
for f in "${FILES[@]}"; do
63+
if [ -f "$f" ]; then
64+
# Replace any semver or semver-SNAPSHOT with the released version
65+
sed -i "s/[0-9]\+\.[0-9]\+\.[0-9]\+\(-SNAPSHOT\)\{0,1\}/${RELEASE_VERSION}/g" "$f"
66+
fi
67+
done
68+
69+
if git diff --quiet; then
70+
echo "No doc version changes needed"
71+
else
72+
git add "${FILES[@]}"
73+
git commit -m "docs: update version references to ${RELEASE_VERSION}"
74+
git push
75+
fi
76+
5077
- name: Create GitHub Release
5178
run: |
5279
VERSION=$(grep '^scm.tag=' release.properties | cut -d'=' -f2)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ Most users only need `mjml-java-core`. Add `mjml-java-resolvers` if you need URL
4040
<dependency>
4141
<groupId>dev.jcputney</groupId>
4242
<artifactId>mjml-java-core</artifactId>
43-
<version>1.0.1-SNAPSHOT</version>
43+
<version>1.0.1</version>
4444
</dependency>
4545
```
4646

4747
### Gradle
4848

4949
```groovy
50-
implementation 'dev.jcputney:mjml-java-core:1.0.1-SNAPSHOT'
50+
implementation 'dev.jcputney:mjml-java-core:1.0.1'
5151
```
5252

5353
### Usage

docs/docs/getting-started/installation.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Add the following dependency to your `pom.xml`:
2828
<dependency>
2929
<groupId>dev.jcputney</groupId>
3030
<artifactId>mjml-java-core</artifactId>
31-
<version>1.0.1-SNAPSHOT</version>
31+
<version>1.0.1</version>
3232
</dependency>
3333
```
3434

@@ -37,13 +37,13 @@ Add the following dependency to your `pom.xml`:
3737
Add the following to your `build.gradle`:
3838

3939
```groovy
40-
implementation 'dev.jcputney:mjml-java-core:1.0.1-SNAPSHOT'
40+
implementation 'dev.jcputney:mjml-java-core:1.0.1'
4141
```
4242

4343
Or for Kotlin DSL (`build.gradle.kts`):
4444

4545
```kotlin
46-
implementation("dev.jcputney:mjml-java-core:1.0.1-SNAPSHOT")
46+
implementation("dev.jcputney:mjml-java-core:1.0.1")
4747
```
4848

4949
## Using the BOM
@@ -58,7 +58,7 @@ To manage versions across multiple modules, import the BOM:
5858
<dependency>
5959
<groupId>dev.jcputney</groupId>
6060
<artifactId>mjml-java-bom</artifactId>
61-
<version>1.0.1-SNAPSHOT</version>
61+
<version>1.0.1</version>
6262
<type>pom</type>
6363
<scope>import</scope>
6464
</dependency>
@@ -81,7 +81,7 @@ To manage versions across multiple modules, import the BOM:
8181

8282
```groovy
8383
dependencies {
84-
implementation platform('dev.jcputney:mjml-java-bom:1.0.1-SNAPSHOT')
84+
implementation platform('dev.jcputney:mjml-java-bom:1.0.1')
8585
implementation 'dev.jcputney:mjml-java-core'
8686
implementation 'dev.jcputney:mjml-java-resolvers'
8787
}

docs/docs/guides/resolvers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Add the resolvers module to your project:
5151
<dependency>
5252
<groupId>dev.jcputney</groupId>
5353
<artifactId>mjml-java-resolvers</artifactId>
54-
<version>1.0.1-SNAPSHOT</version>
54+
<version>1.0.1</version>
5555
</dependency>
5656
```
5757

docs/docs/guides/spring-boot.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Add the Spring module to your project:
1515
<dependency>
1616
<groupId>dev.jcputney</groupId>
1717
<artifactId>mjml-java-spring</artifactId>
18-
<version>1.0.1-SNAPSHOT</version>
18+
<version>1.0.1</version>
1919
</dependency>
2020
```
2121

0 commit comments

Comments
 (0)