8 Commits

Author SHA1 Message Date
88fdc79c82 Merge pull request 'v0.0.8' (#11) from dev into master
Reviewed-on: #11
2026-03-25 07:25:09 +00:00
Timi
c5466ec373 v0.0.8
Some checks failed
CI/CD / build-deploy (pull_request) Failing after 1m15s
2026-03-25 15:24:55 +08:00
571ed377a8 Merge pull request 'v0.0.8' (#10) from dev into master
Reviewed-on: #10
2026-03-25 07:22:40 +00:00
Timi
0cf0458127 v0.0.8
Some checks failed
CI/CD / build-deploy (pull_request) Failing after 5s
2026-03-25 15:22:22 +08:00
6b84af1f16 Merge pull request 'v0.0.8' (#9) from dev into master
Reviewed-on: #9
2026-03-25 07:04:17 +00:00
Timi
d4233f6c46 v0.0.8
Some checks failed
CI/CD / build-deploy (pull_request) Failing after 25s
2026-03-25 15:03:58 +08:00
4302084b95 Merge pull request 'v0.0.8' (#8) from dev into master
Reviewed-on: #8
2026-03-25 06:48:12 +00:00
Timi
b15090d558 v0.0.8
Some checks failed
CI/CD / build-deploy (pull_request) Failing after 1m1s
2026-03-25 14:47:46 +08:00
2 changed files with 33 additions and 70 deletions

View File

@@ -28,7 +28,7 @@ jobs:
echo "Running test suite..."
- name: Build project
run: |
mvn -B -DskipTests clean package source:jar javadoc:jar
mvn -B -DskipTests clean verify
- name: Deploy to Nexus
if: success()
run: |
@@ -59,15 +59,11 @@ jobs:
echo "Missing build artifacts in target"
exit 1
fi
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" \
mvn -B -DskipTests deploy \
-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
if: ${{ success() && startsWith(github.event.pull_request.title, 'v') }}
env:
@@ -92,71 +88,20 @@ jobs:
}
EOF
)
echo "Creating release with tag: $RELEASE_TAG"
echo "API URL: $api_url"
echo "Target commit: $RELEASE_TARGET"
http_code=$(curl -sS -w "%{http_code}" -o /tmp/release_response.json -X POST "$api_url" \
response=$(curl -sS -X POST "$api_url" \
-H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/json" \
-d "$payload")
response=$(cat /tmp/release_response.json)
echo "HTTP Status: $http_code"
echo "Response: $response"
if [ "$http_code" -ne 201 ]; then
echo "Failed to create release (HTTP $http_code)"
if echo "$response" | grep -q "already exists"; then
echo "Release with tag $RELEASE_TAG already exists"
fi
exit 1
fi
release_id=$(echo "$response" | grep -oP '"id":\K[0-9]+' | head -n 1 || true)
if [ -z "$release_id" ]; then
echo "Failed to extract release ID from response"
release_id=$(echo "$response" | grep -o '"id":[0-9]*' | head -n 1 | grep -o '[0-9]*')
if [ -z "$release_id" ] || echo "$response" | grep -q '"message"'; then
echo "Create release failed: $response"
exit 1
fi
echo "Release created: id=$release_id"
echo "Listing jar files in target directory:"
ls -lh target/*.jar || echo "No jar files found"
upload_count=0
for asset_path in target/*.jar; do
if [ ! -f "$asset_path" ]; then
echo "Skipping non-existent file: $asset_path"
continue
fi
asset_name=$(basename "$asset_path")
file_size=$(stat -c%s "$asset_path" 2>/dev/null || echo "unknown")
echo "Uploading asset: $asset_name (size: $file_size bytes)"
upload_url="$api_url/$release_id/assets?name=$asset_name"
echo "Upload URL: $upload_url"
set +e
http_code=$(curl -sS -w "%{http_code}" -o /tmp/asset_response.json -X POST "$upload_url" \
curl -sS -X POST "$api_url/$release_id/assets?name=$asset_name" \
-H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/octet-stream" \
--data-binary @"$asset_path" 2>/dev/null)
curl_exit=$?
set -e
if [ $curl_exit -ne 0 ]; then
echo "✗ Curl failed with exit code $curl_exit for $asset_name"
cat /tmp/asset_response.json 2>/dev/null || echo "No response file"
continue
fi
if [ "$http_code" = "201" ]; then
echo "✓ Successfully uploaded: $asset_name"
upload_count=$((upload_count + 1))
else
echo "✗ Failed to upload $asset_name (HTTP $http_code)"
cat /tmp/asset_response.json 2>/dev/null || echo "No response body"
fi
--data-binary @"$asset_path"
done
echo "Upload complete: $upload_count file(s) uploaded"

26
pom.xml
View File

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