image: gradle:6.8.3-jdk11 variables: LC_ALL: "en_US.UTF-8" LANG: "en_US.UTF-8" LANGUAGE: "en_US" LIB_NAME: "MOA-SIG" GIT_DEPTH: "2" SECURE_LOG_LEVEL: "debug" PROJECT_PACKAGE: '${CI_PROJECT_DIR}/moaSig/moa-sig/build/distributions/*.zip' PROJECT_RELEASE_PACKAGE: "../release/" include: - template: Dependency-Scanning.gitlab-ci.yml - template: Security/SAST.gitlab-ci.yml - template: Secret-Detection.gitlab-ci.yml default: tags: - docker stages: - assemble - test - package - release cache: paths: - .m2/repository - .gradle/wrapper - .gradle/caches assemble: stage: assemble tags: - docker except: - tags script: | cd ./moaSig ./gradlew clean build --warning-mode all artifacts: when: always reports: junit: "**/build/test-results/test/**/TEST-*.xml" release_packaging: stage: package tags: - docker except: - tags before_script: - mkdir -p ~/.ssh - ssh-keyscan apps.egiz.gv.at >> ~/.ssh/known_hosts - chmod 644 ~/.ssh/known_hosts script: | cd ./moaSig ./gradlew assemble uploadArchives artifacts: when: always name: "${CI_PROJECT_NAME}-${CI_COMMIT_SHORT_SHA}" reports: dotenv: variables.env paths: - $PROJECT_PACKAGE release: stage: release image: registry.gitlab.com/gitlab-org/release-cli:latest tags: - docker needs: - job: assemble artifacts: true when: manual only: - master script: | echo "Releasing version $VERSION of $LIB_NAME" echo "Publishing version $VERSION to public EGIZ maven" cd ./moaSig ./gradlew release artifacts: name: "${CI_PROJECT_NAME}-${CI_COMMIT_SHORT_SHA}-release" expire_in: never paths: - "../release/${VERSION}/moa-spss-${VERSION}.zip" - "../release/${VERSION}/moa-spss-lib-${VERSION}.zip"