Skip to content

Commit 7065542

Browse files
committed
auto version
1 parent be6fde5 commit 7065542

File tree

6 files changed

+51
-3
lines changed

6 files changed

+51
-3
lines changed

.github/workflows/reduce-adoc.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ on:
33
push:
44
paths:
55
- '**/*-source.adoc'
6+
- 'version.adoc.template'
7+
- 'pom.xml'
68
branches: ['**']
79
workflow_dispatch:
810

@@ -26,6 +28,16 @@ jobs:
2628
- name: Install asciidoctor-reducer
2729
run: gem install --no-document asciidoctor-reducer
2830

31+
- name: Setup Java
32+
uses: actions/setup-java@v4
33+
with:
34+
distribution: 'temurin'
35+
java-version: '8'
36+
cache: 'maven'
37+
38+
- name: Generate version.adoc
39+
run: mvn generate-resources
40+
2941
- name: Reduce all *-source.adoc files
3042
shell: bash
3143
run: |

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,7 @@ test-push.sh
3030

3131
.DS_Store
3232

33-
src/main/antlr4/.antlr
33+
src/main/antlr4/.antlr
34+
35+
# Auto-generated version file
36+
version.adoc

README-EN-source.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
:toc:
22

3+
include::version.adoc[]
4+
35
= QLExpress
46

57
image::images/logo.png[]
@@ -109,7 +111,7 @@ QLExpress4 supports omitting semicolons, making expressions more concise. For de
109111
<dependency>
110112
<groupId>com.alibaba</groupId>
111113
<artifactId>qlexpress4</artifactId>
112-
<version>4.0.9</version>
114+
<version>{project-version}</version>
113115
</dependency>
114116
----
115117

README-source.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
:toc:
22

3+
include::version.adoc[]
4+
35
= QLExpress
46

57
image::images/logo.png[]
@@ -111,7 +113,7 @@ QLExpress4 支持省略分号,让表达式更加简洁。具体参考 link:#
111113
<dependency>
112114
<groupId>com.alibaba</groupId>
113115
<artifactId>qlexpress4</artifactId>
114-
<version>4.0.9</version>
116+
<version>{project-version}</version>
115117
</dependency>
116118
----
117119

pom.xml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,32 @@
284284
<groupId>org.jacoco</groupId>
285285
<artifactId>jacoco-maven-plugin</artifactId>
286286
</plugin>
287+
<!-- Maven AntRun Plugin for version.adoc generation -->
288+
<plugin>
289+
<groupId>org.apache.maven.plugins</groupId>
290+
<artifactId>maven-antrun-plugin</artifactId>
291+
<version>3.1.0</version>
292+
<executions>
293+
<execution>
294+
<id>generate-version-adoc</id>
295+
<phase>generate-resources</phase>
296+
<goals>
297+
<goal>run</goal>
298+
</goals>
299+
<configuration>
300+
<target>
301+
<copy file="${project.basedir}/version.adoc.template"
302+
tofile="${project.basedir}/version.adoc"
303+
overwrite="true">
304+
<filterset>
305+
<filter token="project.version" value="${project.version}"/>
306+
</filterset>
307+
</copy>
308+
</target>
309+
</configuration>
310+
</execution>
311+
</executions>
312+
</plugin>
287313
</plugins>
288314
</build>
289315
<profiles>

version.adoc.template

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// This file is auto-generated from version.adoc.template by Maven
2+
// DO NOT edit this file directly. Edit version.adoc.template instead.
3+
:project-version: @project.version@

0 commit comments

Comments
 (0)