Skip to content

Commit e4dc3e6

Browse files
gaeljwmpkorstanje
andauthored
Add task and script to automatically update install doc on release (#59)
Co-authored-by: M.P. Korstanje <[email protected]>
1 parent bd67823 commit e4dc3e6

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

Makefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,22 @@ update-major-dependency-versions:
2828
mvn versions:update-properties -DallowMajorUpdates=true -Dmaven.version.rules="file://`pwd`/.m2/maven-version-rules.xml"
2929
.PHONY: update-major-dependency-versions
3030

31+
update-installdoc:
32+
cat docs/install.md | ./scripts/update-install-doc.sh $(NEW_VERSION) > docs/install.md.tmp
33+
mv docs/install.md.tmp docs/install.md
34+
.PHONY: update-installdoc
35+
3136
update-changelog:
3237
cat CHANGELOG.md | ./scripts/update-changelog.sh $(NEW_VERSION) > CHANGELOG.md.tmp
3338
mv CHANGELOG.md.tmp CHANGELOG.md
3439
.PHONY: update-changelog
3540

36-
.commit-and-push-changelog:
37-
git commit -am "Update CHANGELOG for v$(NEW_VERSION)"
41+
.commit-and-push-changelog-and-docs:
42+
git commit -am "Update CHANGELOG and docs for v$(NEW_VERSION)"
3843
git push
3944
.PHONY: .commit-and-push-changelog
4045

41-
release: default update-changelog .commit-and-push-changelog
46+
release: default update-changelog update-installdoc .commit-and-push-changelog-and-docs
4247
mvn --batch-mode release:clean release:prepare -DautoVersionSubmodules=true -Darguments="-DskipTests=true -DskipITs=true -Darchetype.test.skip=true"
4348
git checkout "v$(NEW_VERSION)"
4449
mvn deploy -P-examples -P-compatibility -Psign-source-javadoc -DskipTests=true -DskipITs=true -Darchetype.test.skip=true

scripts/update-install-doc.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
set -uf -o pipefail
3+
4+
# Reads installation doc from STDIN and writes out a new one to STDOUT where:
5+
#
6+
# * the version number is updated for both Maven and sbt
7+
#
8+
9+
new_version=$1
10+
11+
installdoc=$(</dev/stdin)
12+
13+
# Maven
14+
installdoc=$(echo "${installdoc}" | sed "s/<version>[0-9]\+.[0-9]\+.[0-9]\+<\/version>/<version>${new_version}<\/version>/g")
15+
# sbt
16+
installdoc=$(echo "${installdoc}" | sed "s/% \"[0-9]\+.[0-9]\+.[0-9]\+\" %/% \"${new_version}\" %/g")
17+
18+
# Output
19+
echo "${installdoc}"

0 commit comments

Comments
 (0)