Commit 45fa9c62 authored by Philip Makedonski's avatar Philip Makedonski
Browse files

* added change log to release and option to flush cache when running CI from gitlab, #35

parent c9dbe4b3
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -26,6 +26,14 @@
# * Verify but don't deploy merge requests.
# * Deploy built artifacts from master branch only.

spec:
  inputs:
    reset-cache:
      type: boolean
      default: false

---

variables:
  # CI_TARGET_BRANCH: $CI_DEFAULT_BRANCH
  # CI_TARGET_BRANCH: "ttf-022"
@@ -101,6 +109,8 @@ image: maven:3.9.9-eclipse-temurin-21
cache:
  paths:
    - .m2/repository
    - $CI_PROJECT_DIR/.m2/repository


# For merge requests do not `deploy` but only run `verify`.
# See https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
@@ -157,8 +167,7 @@ build-job: # This job runs in the build stage, which runs first.
    # - ls $CI_PROJECT_DIR/.m2/repository
    - echo "Starting.."
    - | 
      if [ $CI_PIPELINE_SOURCE == "web" ]
      then 
      if $[[ inputs.reset-cache ]]; then
        echo "Cleaning caches..." 
        rm -rf $CI_PROJECT_DIR/.m2/* 
        rm -rf ~/.m2/*  
@@ -293,10 +302,12 @@ release-job:
  script:
    # --description "Published automatically, permalink for installation (valid for 7 days) at https://labs.etsi.org/rep/top/ide/-/releases/permalink/latest/downloads/repository." 
    - echo $BUILD_JOB_ID    
    - CHANGES=`git log $(git describe --tags --abbrev=0)..HEAD --format='* %h %s'`
    - |
      release-cli create --name "Release $VERSION $RELEASE_KEY" \
        --tag-name $VERSION \
        --ref $CI_COMMIT_SHA \
        --description "$CHANGES" \
        --assets-link "{\"name\":\"${PACKAGE_NAME} (standalone jar)\",\"url\":\"${PACKAGE_REGISTRY_URL}/${STANDALONE_NAME}\",\"filepath\":\"/standalone-jar\"}" \
        --assets-link "{\"name\":\"${PACKAGE_NAME} (downloadable repository archive)\",\"url\":\"${PACKAGE_REGISTRY_URL}/${ARCHIVE_NAME}\",\"filepath\":\"/repository-archive\"}" \
        --assets-link "{\"name\":\"${PACKAGE_NAME} (snapshot ${RELEASE_KEY} repository for ${VERSION} (exipres in 7 days))\",\"url\":\"${REPO_PREFIX}/${BUILD_JOB_ID}/${REPO_PATH}\"}" \