Compare commits

...

12 Commits

Author SHA1 Message Date
a919cf0a52 Merge pull request 'v0.0.2' (#7) from dev into master
Reviewed-on: #7
2026-01-19 09:24:19 +00:00
3d8168c726 fix CI create release
All checks were successful
CI/CD / build-deploy (pull_request) Successful in 19s
2026-01-19 17:22:02 +08:00
5612d6a24a Merge pull request 'v0.0.2' (#6) from dev into master
Reviewed-on: #6
2026-01-19 09:14:14 +00:00
381d149cd2 fix CI nexus fail
Some checks failed
CI/CD / build-deploy (pull_request) Failing after 30s
2026-01-19 17:13:40 +08:00
db530c1fed Merge pull request 'v0.0.2' (#5) from dev into master
Reviewed-on: #5
2026-01-19 09:08:52 +00:00
3b572491d0 fix CI build jdk
Some checks failed
CI/CD / build-deploy (pull_request) Failing after 1m2s
2026-01-19 17:08:27 +08:00
1fe9cf7b77 Merge pull request 'v0.0.2' (#4) from dev into master
Reviewed-on: #4
2026-01-19 09:03:06 +00:00
452d525d83 add CI Checkout code
Some checks failed
CI/CD / build-deploy (pull_request) Failing after 1m41s
2026-01-19 17:02:45 +08:00
0d21b154ca Merge pull request 'v0.0.2' (#3) from dev into master
Reviewed-on: #3
2026-01-19 08:59:04 +00:00
8153df0b90 remove CI upload-artifact
Some checks failed
CI/CD / build-deploy (pull_request) Failing after 1s
2026-01-19 16:58:38 +08:00
acba4c11d9 Merge pull request 'v0.0.2' (#2) from dev into master
Reviewed-on: #2
2026-01-19 06:43:33 +00:00
af349ca4d6 fix package build fail
Some checks failed
CI/CD / build-deploy (pull_request) Failing after 1s
CI/CD / create-release (pull_request) Has been skipped
2026-01-19 14:42:52 +08:00
2 changed files with 15 additions and 44 deletions

View File

@ -11,7 +11,13 @@ jobs:
build-deploy:
runs-on: act_runner_java
if: ${{ github.event.pull_request.merged == true }}
env:
JAVA_HOME: /usr/lib/jvm/java-21-openjdk
steps:
- name: Checkout code
run: |
git clone ${{ github.server_url }}/${{ github.repository }}.git .
git checkout ${{ github.sha }}
- name: Set up environment
run: |
echo "PR #${{ github.event.number }} merged into master"
@ -23,7 +29,7 @@ jobs:
- name: Build project
run: |
mvn -B -DskipTests clean package source:jar javadoc:jar
- name: Deploy
- name: Deploy to Nexus
if: success()
run: |
if [ -z "${{ secrets.NEXUS_USERNAME }}" ] || [ -z "${{ secrets.NEXUS_PASSWORD }}" ]; then
@ -59,25 +65,11 @@ jobs:
-Djavadoc="$javadoc_jar" \
-DpomFile="./pom.xml" \
-Durl="https://nexus.imyeyu.com/repository/maven-releases/" \
-DrepositoryId="timi-nexus"
- name: Upload jar artifact
if: success()
uses: actions/upload-artifact@v3
with:
name: build-jar
path: target/*.jar
if-no-files-found: error
create-release:
runs-on: act_runner_base
needs: build-deploy
if: ${{ success() && github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'master' && startsWith(github.event.pull_request.title, 'v') }}
steps:
- name: Download jar artifact
uses: actions/download-artifact@v3
with:
name: build-jar
path: dist
-DrepositoryId="timi-nexus" \
-Dhttps.protocols=TLSv1.2 \
-Djdk.tls.client.protocols=TLSv1.2
- name: Create release
if: ${{ success() && startsWith(github.event.pull_request.title, 'v') }}
env:
GITEA_TOKEN: ${{ secrets.RUNNER_TOKEN }}
GITEA_SERVER_URL: ${{ github.server_url }}
@ -104,16 +96,13 @@ jobs:
-H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/json" \
-d "$payload")
release_id=$(echo "$response" | sed -n 's/.*"id":[ ]*\\([0-9][0-9]*\\).*/\\1/p' | head -n 1)
if [ -z "$release_id" ]; 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
if ! ls dist/*.jar >/dev/null 2>&1; then
echo "Missing jar artifact in dist"
exit 1
fi
for asset_path in dist/*.jar; do
echo "Release created: id=$release_id"
for asset_path in target/*.jar; do
asset_name=$(basename "$asset_path")
curl -sS -X POST "$api_url/$release_id/assets?name=$asset_name" \
-H "Authorization: token $GITEA_TOKEN" \

18
pom.xml
View File

@ -27,29 +27,11 @@
<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-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.11.2</version>
<executions>
<execution>
<id>attach-javadocs</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>