Merge pull request 'v0.0.8' (#13) from dev into master

Reviewed-on: #13
This commit was merged in pull request #13.
This commit is contained in:
2026-03-25 07:41:06 +00:00
2 changed files with 15 additions and 30 deletions

View File

@@ -28,7 +28,7 @@ jobs:
echo "Running test suite..." echo "Running test suite..."
- name: Build project - name: Build project
run: | run: |
mvn -B -DskipTests clean verify mvn -B -DskipTests clean package source:jar javadoc:jar
- name: Deploy to Nexus - name: Deploy to Nexus
if: success() if: success()
run: | run: |
@@ -59,11 +59,15 @@ jobs:
echo "Missing build artifacts in target" echo "Missing build artifacts in target"
exit 1 exit 1
fi fi
mvn -B -DskipTests deploy \ mvn -B deploy:deploy-file \
-Dfile="$main_jar" \
-Dsources="$sources_jar" \
-Djavadoc="$javadoc_jar" \
-DpomFile="./pom.xml" \
-Durl="https://nexus.imyeyu.com/repository/maven-releases/" \
-DrepositoryId="timi-nexus" \
-Dhttps.protocols=TLSv1.2 \ -Dhttps.protocols=TLSv1.2 \
-Djdk.tls.client.protocols=TLSv1.2 \ -Djdk.tls.client.protocols=TLSv1.2
-Dmaven.wagon.http.retryHandler.count=3 \
-Dmaven.wagon.rto=1800000
- name: Create release - name: Create release
if: ${{ success() && startsWith(github.event.pull_request.title, 'v') }} if: ${{ success() && startsWith(github.event.pull_request.title, 'v') }}
env: env:
@@ -88,20 +92,19 @@ jobs:
} }
EOF EOF
) )
response=$(curl -fsS -X POST "$api_url" \ response=$(curl -sS -X POST "$api_url" \
-H "Authorization: token $GITEA_TOKEN" \ -H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d "$payload") -d "$payload")
response=$(printf '%s' "$response" | tr -d '\r\n') release_id=$(echo "$response" | grep -o '"id":[0-9]*' | head -n 1 | grep -o '[0-9]*')
release_id=$(printf '%s' "$response" | sed -n 's/.*"id":\([0-9][0-9]*\).*/\1/p') if [ -z "$release_id" ] || echo "$response" | grep -q '"message"'; then
if [ -z "$release_id" ] || printf '%s' "$response" | grep -q '"message"'; then
echo "Create release failed: $response" echo "Create release failed: $response"
exit 1 exit 1
fi fi
echo "Release created: id=$release_id" echo "Release created: id=$release_id"
for asset_path in target/*.jar; do for asset_path in target/*.jar; do
asset_name=$(basename "$asset_path") asset_name=$(basename "$asset_path")
curl -fsS -X POST "$api_url/$release_id/assets?name=$asset_name" \ curl -sS -X POST "$api_url/$release_id/assets?name=$asset_name" \
-H "Authorization: token $GITEA_TOKEN" \ -H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/octet-stream" \ -H "Content-Type: application/octet-stream" \
--data-binary @"$asset_path" --data-binary @"$asset_path"

22
pom.xml
View File

@@ -27,15 +27,6 @@
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId> <artifactId>maven-source-plugin</artifactId>
<version>3.3.1</version> <version>3.3.1</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>
@@ -73,29 +64,20 @@
<charset>UTF-8</charset> <charset>UTF-8</charset>
<docencoding>UTF-8</docencoding> <docencoding>UTF-8</docencoding>
</configuration> </configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<distributionManagement> <distributionManagement>
<repository> <repository>
<id>timi-nexus</id> <id>timi_nexus</id>
<url>https://nexus.imyeyu.com/repository/maven-releases/</url> <url>https://nexus.imyeyu.com/repository/maven-releases/</url>
</repository> </repository>
</distributionManagement> </distributionManagement>
<repositories> <repositories>
<repository> <repository>
<id>timi-nexus</id> <id>timi_nexus</id>
<url>https://nexus.imyeyu.com/repository/maven-public/</url> <url>https://nexus.imyeyu.com/repository/maven-public/</url>
<releases> <releases>
<enabled>true</enabled> <enabled>true</enabled>