Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
eos-config-loader
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
qg-components
eos-config-loader
Commits
2f091680
Commit
2f091680
authored
Sep 15, 2025
by
biao.dong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加 GitLab CI/CD 发布配置
parent
af354436
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
1 deletion
+79
-1
.gitlab-ci.yml
.gitlab-ci.yml
+78
-0
README.md
README.md
+1
-1
No files found.
.gitlab-ci.yml
0 → 100644
View file @
2f091680
stages
:
-
build
-
test
-
publish
-
release
image
:
maven:3.8.6-openjdk-17
variables
:
MAVEN_CLI_OPTS
:
"
--batch-mode
--errors
--fail-at-end
-Dmaven.test.skip=true"
PACKAGE_REGISTRY_URL
:
"
${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/maven"
cache
:
key
:
"
${CI_COMMIT_REF_SLUG}"
paths
:
-
.m2/repository/
-
target/
build-job
:
stage
:
build
script
:
-
mvn $MAVEN_CLI_OPTS clean compile
artifacts
:
paths
:
-
target/
expire_in
:
1 hour
test-job
:
stage
:
test
script
:
-
mvn $MAVEN_CLI_OPTS test
dependencies
:
-
build-job
publish-snapshot
:
stage
:
publish
script
:
-
mvn $MAVEN_CLI_OPTS -DskipTests deploy -DaltDeploymentRepository=gitlab-maven::default::${PACKAGE_REGISTRY_URL}
only
:
-
develop
publish-release
:
stage
:
publish
script
:
-
mvn $MAVEN_CLI_OPTS -DskipTests deploy -DaltDeploymentRepository=gitlab-maven::default::${PACKAGE_REGISTRY_URL}
only
:
-
tags
create-release
:
stage
:
release
image
:
curlimages/curl:latest
script
:
-
|
RELEASE_VERSION="${CI_COMMIT_TAG}"
RELEASE_NOTES="Automated release for version ${RELEASE_VERSION}"
# 创建 GitLab Release
curl --header "Content-Type: application/json" \
--header "PRIVATE-TOKEN: ${CI_JOB_TOKEN}" \
--data "{
\"name\": \"Release ${RELEASE_VERSION}\",
\"tag_name\": \"${RELEASE_VERSION}\",
\"description\": \"${RELEASE_NOTES}\"
}" \
--request POST \
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/releases"
# 可选:上传 JAR 文件到 Release
# 首先找到最新构建的 JAR 文件
JAR_FILE=$(find target -name "*.jar" | head -n 1)
if [ -n "$JAR_FILE" ]; then
echo "Uploading $JAR_FILE to release"
curl --header "PRIVATE-TOKEN: ${CI_JOB_TOKEN}" \
--upload-file "$JAR_FILE" \
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/releases/${RELEASE_VERSION}/assets/${JAR_FILE##*/}"
fi
only
:
-
tags
\ No newline at end of file
R
eadme
.md
→
R
EADME
.md
View file @
2f091680
...
...
@@ -31,7 +31,7 @@ redis.port=${REDIS_SERVICE_PORT_6379}
<dependency>
<groupId>
com.example
</groupId>
<artifactId>
eos-config-loader
</artifactId>
<version>
1.0.
0
</version>
<version>
1.0.
1
</version>
</dependency>
```
#### 2.在 application.yml 中添加:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment