Skip to content

Commit e566889

Browse files
committed
升级依赖
1 parent dad0be2 commit e566889

File tree

2 files changed

+233
-79
lines changed

2 files changed

+233
-79
lines changed

.github/workflows/ci.yml

Lines changed: 113 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,136 @@ on:
55
- master
66
jobs:
77
build-and-deploy:
8+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on
89
runs-on: ubuntu-latest
910
steps:
10-
- name: Checkout 🛎️
11-
uses: actions/checkout@v3
11+
# https://github.com/actions/setup-node
12+
- name: Setup Node.js 🕸
13+
uses: actions/setup-node@v4
14+
with:
15+
# https://github.com/nvm-sh/nvm#long-term-support
16+
node-version: 'lts/*'
17+
18+
# https://github.com/actions/checkout
19+
- name: Checkout
20+
uses: actions/checkout@v4
1221
with:
1322
persist-credentials: false
1423

15-
- name: Set up JDK 17 ☕️
16-
uses: actions/setup-java@v3
24+
# https://github.com/actions/setup-java
25+
- name: Set up JDK ☕️
26+
uses: actions/setup-java@v4
1727
with:
18-
java-version: '17'
1928
distribution: 'corretto'
29+
java-version: '21'
30+
cache: 'maven'
2031

2132
- name: Install Graphviz 🐰
2233
run: |
2334
sudo apt update -y -m
2435
sudo apt install -y graphviz
2536
37+
- name: Improve Document 📝
38+
run: |
39+
cd docs
40+
sed -i 's@xref:\([^\.]*\).adoc\[[^:]*\]@<<\1>>@g' *.adoc
41+
cd ..
42+
# 处理 sed 不支持非贪婪模式
43+
# https://stackoverflow.com/a/46719361
44+
# https://stackoverflow.com/a/1103159
45+
2646
- name: Build 🔧
27-
run: mvn clean package
47+
run: |
48+
mvn clean package
49+
50+
- name: Add Reward Qrcode 💰
51+
run: |
52+
cd target/docs/multipage/
53+
find . -name "*.html" | xargs -I {} sed -i 's@\(<div id="content">\)@\1<div class="sect2"><h3 id="_友情支持">友情支持</h3><div class="paragraph"><p>如果您觉得这个笔记对您有所帮助,看在D瓜哥码这么多字的辛苦上,请友情支持一下,D瓜哥感激不尽,😜</p></div><table class="tableblock frame-none grid-all stretch"><colgroup><col style="width: 50%;"><col style="width: 50%;"></colgroup><tbody><tr><td class="tableblock halign-center valign-top"><p class="tableblock"><span class="image"><img src="./images/alipay.png" alt="支付宝" width="85%" title="支付宝"></span></p></td><td class="tableblock halign-center valign-top"><p class="tableblock"><span class="image"><img src="./images/wxpay.jpg" alt="微信" width="85%" title="微信"></span></p></td></tr></tbody></table><div class="paragraph"><p>有些打赏的朋友希望可以加个好友,欢迎关注D 瓜哥的微信公众号,这样就可以通过公众号的回复直接给我发信息。</p></div><div class="paragraph"><p><span class="image"><img src="./images/wx-jikerizhi.png" alt="wx jikerizhi" width="98%"></span></p></div><div class="admonitionblock tip"><table><tbody><tr><td class="icon"><i class="fa icon-tip" title="Tip"></i></td><td class="content"><strong>公众号的微信号是: <code>jikerizhi</code></strong>。<em>因为众所周知的原因,有时图片加载不出来。 如果图片加载不出来可以直接通过搜索微信号来查找我的公众号。</em></td></tr></tbody></table></div></div>@' {}
54+
55+
# - name: Add Tab Resource 🌗
56+
# run: |
57+
# cp -R docs/assets target/docs/multipage/
58+
# cd target/docs/multipage/
59+
# sed -i 's@>题解@ target="_blank">题解@g' logbook-*.html
60+
# mv images/* assets/images/
61+
# sed -i 's@src="asciidoctor-tabs.js"@src="assets/scripts/asciidoctor-tabs.js"@g' *.html
62+
# sed -i 's@img src="./images@img src="assets/images@g' *.html
63+
64+
- name: Add Scroll TOC JS 🐌
65+
run: |
66+
touch target/docs/multipage/assets/scripts/scroll-toc.js
67+
cat > target/docs/multipage/assets/scripts/scroll-toc.js <<- EOF
68+
document.querySelector('#toc li a span.toc-current')
69+
.scrollIntoView({ behavior: "smooth", block: "center", inline: "nearest" });
70+
EOF
71+
cd target/docs/multipage/
72+
sed -i 's@</body>@<script src="assets/scripts/scroll-toc.js"></script></body>@g' *.html
73+
sed -i 's@\(.toc-current{\)@\1color:#d14;font-size:130%;@g' *.html
74+
75+
- name: Rename Title 🤡
76+
run: |
77+
cd target/docs/multipage/
78+
for file in ./*.html;
79+
do
80+
# https://ioflood.com/blog/bash-not-equal/
81+
if [ "${file}" != "./index.html" ]; then
82+
subtitle=$(grep '<h2.*></a>' $file | awk -F'>' '{print $4}' | awk -F'<' '{print $1}')
83+
echo "$file -- $subtitle"
84+
if [ "${subtitle}" != "" ]; then
85+
# 将变量中的 & 替换为 \&
86+
escaped_title=$(sed 's/&/\\&/g' <<< "${subtitle}")
87+
sed -i "s@ 解题笔记</h1>@: ${escaped_title}</h1>@g" $file
88+
sed -i "s@ 解题笔记</title>@: ${escaped_title}</title>@g" $file
89+
fi
90+
fi
91+
done
92+
93+
# https://goalsmashers.github.io/css-minification-benchmark/
94+
- name: Compress CSS 🍭
95+
run: |
96+
# https://github.com/parcel-bundler/lightningcss
97+
npm install -g clean-css-cli
98+
# Multiple HTML page
99+
cd target/docs/
100+
for f in `find . -name "*.css"`;
101+
do
102+
fn="${f%.*}.min.css";
103+
echo "compress $f"
104+
cleancss -o $fn $f
105+
rm -rf $f;
106+
mv $fn $f
107+
done
108+
109+
# https://github.com/privatenumber/minification-benchmarks
110+
- name: Compress JS 🐢
111+
run: |
112+
# https://github.com/mishoo/UglifyJS
113+
npm install uglify-js -g
114+
# Multiple HTML page
115+
cd target/docs/
116+
for f in `find . -name "*.js"`;
117+
do
118+
fn="${f%.*}.min.css";
119+
echo "compress $f"
120+
uglifyjs $f --compress --rename -o $fn
121+
rm -rf $f;
122+
mv $fn $f
123+
done
124+
125+
- name: Add links for comments 🔗
126+
run: |
127+
cd target/docs/
128+
for file in `find . -name "*.html"`;
129+
do
130+
sed -i 's@\(D瓜哥 · https://www.diguage.com\)@<a href="https://www.diguage.com" class="cmt-link" target="_blank">\1</a>@g' $file
131+
done
28132
133+
# https://github.com/JamesIves/github-pages-deploy-action
29134
- name: Deploy 🚀
30135
uses: JamesIves/github-pages-deploy-action@v4
31136
with:
137+
# GITHUB_TOKEN: ${{ secrets.CI_TOKEN }}
32138
branch: gh-pages # The branch the action should deploy to.
33-
folder: target/docs/html # The folder the action should deploy.
139+
folder: target/docs/multipage # The folder the action should deploy.
34140
single-commit: true

pom.xml

Lines changed: 120 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -13,43 +13,65 @@
1313
<url>https://www.diguage.com/</url>
1414

1515
<properties>
16+
<jgroups.version>5.3.10.Final</jgroups.version>
1617
<jol.version>0.17</jol.version>
1718
<jmh.version>1.37</jmh.version>
18-
<gson.version>2.10.1</gson.version>
19-
<joda.version>2.12.5</joda.version>
20-
<byte-buddy.version>1.14.11</byte-buddy.version>
21-
<netty.version>4.1.104.Final</netty.version>
22-
<protobuf.version>3.25.1</protobuf.version>
23-
<guava.version>33.0.0-jre</guava.version>
19+
<gson.version>2.11.0</gson.version>
20+
<joda.version>2.12.7</joda.version>
21+
<byte-buddy.version>1.14.18</byte-buddy.version>
22+
<netty.version>4.1.112.Final</netty.version>
23+
<protobuf.version>4.27.3</protobuf.version>
24+
<guava.version>33.2.1-jre</guava.version>
2425
<commons-collections4.version>4.4</commons-collections4.version>
2526
<eclipse-collections.version>11.1.0</eclipse-collections.version>
26-
<slf4j.version>1.7.36</slf4j.version>
27-
<logback.version>1.2.12</logback.version>
27+
<slf4j.version>2.0.13</slf4j.version>
28+
<logback.version>1.5.6</logback.version>
2829

29-
<junit.version>5.10.1</junit.version>
30-
<assertj.version>3.25.1</assertj.version>
30+
<junit.version>5.10.3</junit.version>
31+
<assertj.version>3.26.3</assertj.version>
3132

32-
<asciidoctorj.version>2.5.11</asciidoctorj.version>
33-
<asciidoctorj-pdf.version>2.3.10</asciidoctorj-pdf.version>
34-
<asciidoctorj-epub3.version>1.5.1</asciidoctorj-epub3.version>
35-
<asciidoctorj-diagram.version>2.2.14</asciidoctorj-diagram.version>
33+
<asciidoctorj.version>3.0.0</asciidoctorj.version>
34+
<asciidoctorj-pdf.version>2.3.19</asciidoctorj-pdf.version>
35+
<asciidoctorj-epub3.version>2.1.3</asciidoctorj-epub3.version>
36+
<asciidoctorj-diagram.version>2.3.1</asciidoctorj-diagram.version>
37+
<asciidoctor-diagram.version>2.3.1</asciidoctor-diagram.version>
38+
<asciidoctor-diagram-plantuml.version>1.2025.2</asciidoctor-diagram-plantuml.version>
39+
<rouge.version>4.5.1</rouge.version>
3640
<asciidoctor-multipage.version>0.0.19</asciidoctor-multipage.version>
37-
<asciidoctor-comment-links.version>0.0.1</asciidoctor-comment-links.version>
38-
<asciidoctor-maven-plugin.version>2.2.4</asciidoctor-maven-plugin.version>
39-
<jruby.version>9.4.5.0</jruby.version>
41+
<asciidoctor-comment-links.version>0.0.2</asciidoctor-comment-links.version>
42+
<asciidoctor-tabs.version>1.0.0.beta.6</asciidoctor-tabs.version>
43+
<asciidoclet.version>2.0.0</asciidoclet.version>
44+
<asciidoctor-maven-plugin.version>3.1.1</asciidoctor-maven-plugin.version>
45+
<mavengem-wagon.version>2.0.2</mavengem-wagon.version>
46+
<gem-maven-plugin.version>3.0.5</gem-maven-plugin.version>
47+
<download-maven-plugin.version>1.13.0</download-maven-plugin.version>
48+
<exec-maven-plugin.version>3.5.0</exec-maven-plugin.version>
49+
<jruby.version>9.4.12.0</jruby.version>
4050
<gem.path>${project.basedir}/cfg/gems</gem.path>
4151
<pdf-fonts.path>${project.basedir}/cfg/fonts</pdf-fonts.path>
4252
<pdf-fonts.baseuri>https://github.com/diguage/open-fonts/releases/download/latest</pdf-fonts.baseuri>
4353

44-
<mavengem-wagon.version>1.0.3</mavengem-wagon.version>
45-
<gem-maven-plugin.version>2.0.1</gem-maven-plugin.version>
46-
<download-maven-plugin.version>1.8.0</download-maven-plugin.version>
47-
<maven.compiler.source>17</maven.compiler.source>
48-
<maven.compiler.target>17</maven.compiler.target>
54+
<java.version>21</java.version>
55+
<maven.compiler.source>${java.version}</maven.compiler.source>
56+
<maven.compiler.target>${java.version}</maven.compiler.target>
57+
<maven.compiler.release>${java.version}</maven.compiler.release>
4958
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
59+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
5060
</properties>
5161

5262
<dependencies>
63+
<!-- https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp -->
64+
<dependency>
65+
<groupId>com.squareup.okhttp3</groupId>
66+
<artifactId>okhttp</artifactId>
67+
<version>4.12.0</version>
68+
</dependency>
69+
<!-- https://mvnrepository.com/artifact/org.jgroups/jgroups -->
70+
<dependency>
71+
<groupId>org.jgroups</groupId>
72+
<artifactId>jgroups</artifactId>
73+
<version>${jgroups.version}</version>
74+
</dependency>
5375
<dependency>
5476
<groupId>com.google.code.gson</groupId>
5577
<artifactId>gson</artifactId>
@@ -150,6 +172,25 @@
150172
<version>${assertj.version}</version>
151173
</dependency>
152174

175+
<dependency>
176+
<groupId>rubygems</groupId>
177+
<artifactId>rouge</artifactId>
178+
<version>${rouge.version}</version>
179+
<type>gem</type>
180+
</dependency>
181+
<dependency>
182+
<groupId>rubygems</groupId>
183+
<!-- https://github.com/asciidoctor/asciidoctor-tabs -->
184+
<artifactId>asciidoctor-tabs</artifactId>
185+
<version>${asciidoctor-tabs.version}</version>
186+
<type>gem</type>
187+
<exclusions>
188+
<exclusion>
189+
<groupId>rubygems</groupId>
190+
<artifactId>asciidoctor</artifactId>
191+
</exclusion>
192+
</exclusions>
193+
</dependency>
153194
<dependency>
154195
<groupId>rubygems</groupId>
155196
<artifactId>asciidoctor-multipage</artifactId>
@@ -178,14 +219,14 @@
178219
<build>
179220
<extensions>
180221
<extension> <!-- this allows us to download gems -->
181-
<groupId>org.torquebox.mojo</groupId>
222+
<groupId>org.jruby.maven</groupId>
182223
<artifactId>mavengem-wagon</artifactId>
183224
<version>${mavengem-wagon.version}</version>
184225
</extension>
185226
</extensions>
186227
<plugins>
187228
<plugin>
188-
<groupId>de.saumya.mojo</groupId>
229+
<groupId>org.jruby.maven</groupId>
189230
<artifactId>gem-maven-plugin</artifactId>
190231
<version>${gem-maven-plugin.version}</version>
191232
<configuration>
@@ -405,6 +446,8 @@
405446
<html_src_attr>source%nowrap,html,{source_attr}</html_src_attr>
406447
<image_attr>align="center",width=100%</image_attr>
407448
<diagram_attr>format=svg,align="center",width=90%</diagram_attr>
449+
<plantumlconfig>${project.basedir}/cfg/plantuml.cfg</plantumlconfig>
450+
<iconfont-cdn>//cdn.jsdelivr.net/npm/[email protected]/css/font-awesome.min.css</iconfont-cdn>
408451
</attributes>
409452
</configuration>
410453
<executions>
@@ -433,23 +476,28 @@
433476
</attributes>
434477
</configuration>
435478
</execution>
436-
<execution>
437-
<id>generate-html</id>
438-
<phase>package</phase>
439-
<goals>
440-
<goal>process-asciidoc</goal>
441-
</goals>
442-
<configuration>
443-
<backend>html5</backend>
444-
<doctype>book</doctype>
445-
<outputDirectory>${project.build.directory}/docs/html</outputDirectory>
446-
<attributes>
447-
<toc>left</toc>
448-
<docinfo1>true</docinfo1>
449-
<source_attr>indent=0,subs="attributes,verbatim,quotes"</source_attr>
450-
</attributes>
451-
</configuration>
452-
</execution>
479+
<!-- <execution>-->
480+
<!-- <id>generate-html</id>-->
481+
<!-- <phase>package</phase>-->
482+
<!-- <goals>-->
483+
<!-- <goal>process-asciidoc</goal>-->
484+
<!-- </goals>-->
485+
<!-- <configuration>-->
486+
<!-- <backend>html5</backend>-->
487+
<!-- <doctype>book</doctype>-->
488+
<!-- <gemPath>${gem.path}</gemPath>-->
489+
<!-- <requires>-->
490+
<!-- <require>asciidoctor-diagram</require>-->
491+
<!-- <require>asciidoctor-comment-links</require>-->
492+
<!-- </requires>-->
493+
<!-- <outputDirectory>${project.build.directory}/docs/html</outputDirectory>-->
494+
<!-- <attributes>-->
495+
<!-- <toc>left</toc>-->
496+
<!-- <docinfo1>true</docinfo1>-->
497+
<!-- <source_attr>indent=0,subs="attributes,verbatim,quotes"</source_attr>-->
498+
<!-- </attributes>-->
499+
<!-- </configuration>-->
500+
<!-- </execution>-->
453501
<!-- <execution>-->
454502
<!-- <id>generate-epub</id>-->
455503
<!-- <phase>package</phase>-->
@@ -480,37 +528,37 @@
480528
<!-- </attributes>-->
481529
<!-- </configuration>-->
482530
<!-- </execution>-->
483-
<!-- <execution>-->
484-
<!-- <id>generate-pdf</id>-->
485-
<!-- <phase>package</phase>-->
486-
<!-- <goals>-->
487-
<!-- <goal>process-asciidoc</goal>-->
488-
<!-- </goals>-->
489-
<!-- <configuration>-->
490-
<!-- <backend>pdf</backend>-->
491-
<!-- <outputDirectory>${project.build.directory}/docs/pdf</outputDirectory>-->
492-
<!-- <attributes>-->
493-
<!-- <allow-uri-read/>-->
494-
<!-- <plantumlconfig>${project.basedir}/cfg/plantuml.cfg</plantumlconfig>-->
495-
<!-- <pdf-fontsdir>${project.basedir}/cfg/fonts</pdf-fontsdir>-->
496-
<!-- <pdf-themesdir>${project.basedir}/cfg/theme</pdf-themesdir>-->
497-
<!-- &lt;!&ndash; Set Source theme &ndash;&gt;-->
498-
<!-- <pdf-theme>Source</pdf-theme>-->
499-
<!-- <pagenums/>-->
500-
<!-- <toc/>-->
501-
<!-- <idprefix/>-->
502-
<!-- <idseparator>-</idseparator>-->
503-
<!-- &lt;!&ndash; Fixes line wraps formatting inserting zero-width spaces (ZWSP) before CJ characters &ndash;&gt;-->
504-
<!-- <scripts>cjk</scripts>-->
505-
<!-- <pdf-version>1.7</pdf-version>-->
506-
<!-- <rouge-style>github</rouge-style>-->
507-
<!-- &lt;!&ndash;<media>screen</media>&ndash;&gt;-->
508-
<!-- &lt;!&ndash;<optimize>screen</optimize>&ndash;&gt;-->
509-
<!-- &lt;!&ndash;<media>prepress</media>&ndash;&gt;-->
510-
<!-- &lt;!&ndash;<optimize>prepress</optimize>&ndash;&gt;-->
511-
<!-- </attributes>-->
512-
<!-- </configuration>-->
513-
<!-- </execution>-->
531+
<!-- <execution>-->
532+
<!-- <id>generate-pdf</id>-->
533+
<!-- <phase>package</phase>-->
534+
<!-- <goals>-->
535+
<!-- <goal>process-asciidoc</goal>-->
536+
<!-- </goals>-->
537+
<!-- <configuration>-->
538+
<!-- <backend>pdf</backend>-->
539+
<!-- <outputDirectory>${project.build.directory}/docs/pdf</outputDirectory>-->
540+
<!-- <attributes>-->
541+
<!-- <allow-uri-read/>-->
542+
<!-- <plantumlconfig>${project.basedir}/cfg/plantuml.cfg</plantumlconfig>-->
543+
<!-- <pdf-fontsdir>${project.basedir}/cfg/fonts</pdf-fontsdir>-->
544+
<!-- <pdf-themesdir>${project.basedir}/cfg/theme</pdf-themesdir>-->
545+
<!-- &lt;!&ndash; Set Source theme &ndash;&gt;-->
546+
<!-- <pdf-theme>Source</pdf-theme>-->
547+
<!-- <pagenums/>-->
548+
<!-- <toc/>-->
549+
<!-- <idprefix/>-->
550+
<!-- <idseparator>-</idseparator>-->
551+
<!-- &lt;!&ndash; Fixes line wraps formatting inserting zero-width spaces (ZWSP) before CJ characters &ndash;&gt;-->
552+
<!-- <scripts>cjk</scripts>-->
553+
<!-- <pdf-version>1.7</pdf-version>-->
554+
<!-- <rouge-style>github</rouge-style>-->
555+
<!-- &lt;!&ndash;<media>screen</media>&ndash;&gt;-->
556+
<!-- &lt;!&ndash;<optimize>screen</optimize>&ndash;&gt;-->
557+
<!-- &lt;!&ndash;<media>prepress</media>&ndash;&gt;-->
558+
<!-- &lt;!&ndash;<optimize>prepress</optimize>&ndash;&gt;-->
559+
<!-- </attributes>-->
560+
<!-- </configuration>-->
561+
<!-- </execution>-->
514562
</executions>
515563
<dependencies>
516564
<dependency>

0 commit comments

Comments
 (0)