Skip to content

Commit

Permalink
Update the version in examples/maven/pom.xml after the release (#1440)
Browse files Browse the repository at this point in the history
### What's done:

 * Now, after each release, the example Maven project version is correctly
   updated to match the next SNAPSHOT version.
  • Loading branch information
0x6675636b796f75676974687562 authored Jul 12, 2022
1 parent c4f34c8 commit 8200636
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ jobs:
cp diktat-rules/src/main/resources/diktat-analysis.yml $(dirname $file)
done
next_snapshot_version=$(printf 'VERSION=${project.version}\n0\n' | mvn help:evaluate | grep '^VERSION' | cut -d= -f2)
# Update the version in `examples/maven/pom.xml`
# (which is not a part of the multi-module project).
for file in examples/maven/pom.xml
do
sed -i "s|\(<version>\)[[:digit:]]\(\.[[:digit:]]\)\+-SNAPSHOT\(</version>\)|\1${next_snapshot_version}\3|g" "${file}" || echo "File ${file} hasn't been updated (2nd sed pass)"
done
echo "version=$next_snapshot_version" > info/buildSrc/gradle.properties
- name: Create pull request
uses: peter-evans/create-pull-request@v4
Expand Down
2 changes: 1 addition & 1 deletion examples/maven/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>org.cqfn.diktat</groupId>
<artifactId>diktat-examples-maven</artifactId>
<packaging>pom</packaging>
<version>1.2.1-SNAPSHOT</version>
<version>1.2.2-SNAPSHOT</version>

<properties>
<diktat.version>1.2.1</diktat.version>
Expand Down

0 comments on commit 8200636

Please sign in to comment.