diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ea05e89..09333a0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,10 +1,10 @@ -stages : +stages : - compile - package - release # 编译 -compile : +compile : stage : compile tags : - linux-maven @@ -16,7 +16,7 @@ compile : # 打包 -package : +package : stage : package tags : - linux-maven @@ -28,14 +28,17 @@ package : # 发布 release_job: - stage: release - image: registry.gitlab.com/gitlab-org/release-cli:latest - tags: + stage : release + image : registry.gitlab.com/gitlab-org/release-cli:latest + tags : - linux-maven - rules: - - if: $CI_COMMIT_TAG # Run this job when a tag is created - script: + rules : + - if : $CI_COMMIT_TAG # Run this job when a tag is created + when: never + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Run this job when commits are pushed or merged to the default branch + script : - echo "running release_job" - release: # See https://docs.gitlab.com/ee/ci/yaml/#release for available properties - tag_name: '$CI_COMMIT_TAG' - description: '$CI_COMMIT_TAG' \ No newline at end of file + release: # See https://docs.gitlab.com/ee/ci/yaml/#release for available properties + tag_name : '$CI_COMMIT_TAG' + name : 'Release $CI_COMMIT_TAG' + description: './CHANGELOG.md' \ No newline at end of file