This commit is contained in:
@@ -28,7 +28,7 @@ jobs:
|
||||
echo "Running test suite..."
|
||||
- name: Build project
|
||||
run: |
|
||||
mvn -B -DskipTests clean verify
|
||||
mvn -B -DskipTests clean package source:jar javadoc:jar
|
||||
- name: Deploy to Nexus
|
||||
if: success()
|
||||
run: |
|
||||
@@ -59,11 +59,15 @@ jobs:
|
||||
echo "Missing build artifacts in target"
|
||||
exit 1
|
||||
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 \
|
||||
-Djdk.tls.client.protocols=TLSv1.2 \
|
||||
-Dmaven.wagon.http.retryHandler.count=3 \
|
||||
-Dmaven.wagon.rto=1800000
|
||||
-Djdk.tls.client.protocols=TLSv1.2
|
||||
- name: Create release
|
||||
if: ${{ success() && startsWith(github.event.pull_request.title, 'v') }}
|
||||
env:
|
||||
@@ -88,20 +92,19 @@ jobs:
|
||||
}
|
||||
EOF
|
||||
)
|
||||
response=$(curl -fsS -X POST "$api_url" \
|
||||
response=$(curl -sS -X POST "$api_url" \
|
||||
-H "Authorization: token $GITEA_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$payload")
|
||||
response=$(printf '%s' "$response" | tr -d '\r\n')
|
||||
release_id=$(printf '%s' "$response" | sed -n 's/.*"id":\([0-9][0-9]*\).*/\1/p')
|
||||
if [ -z "$release_id" ] || printf '%s' "$response" | grep -q '"message"'; then
|
||||
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"
|
||||
for asset_path in target/*.jar; do
|
||||
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 "Content-Type: application/octet-stream" \
|
||||
--data-binary @"$asset_path"
|
||||
|
||||
22
pom.xml
22
pom.xml
@@ -27,15 +27,6 @@
|
||||
<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>
|
||||
@@ -73,29 +64,20 @@
|
||||
<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>
|
||||
|
||||
Reference in New Issue
Block a user