diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0f1569d..30b27fd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,7 +46,7 @@ jobs: export REGISTRY_PASSWORD="${GITHUB_TOKEN}" export POM_VERSION="$(mvn help:evaluate -D expression=project.version -q -D forceStdout)" - git config user.name "${GIT_USERNAME}" + git config --global user.name "${GIT_USERNAME}" ./mvnw -D image.registry=ghcr.io/jaguililla/hexagonal_spring -D spring-boot.build-image.publish=true -B deploy git tag -m "Release ${POM_VERSION}" "${POM_VERSION}" git push --tags diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bc058bd..1c2c833 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -32,7 +32,7 @@ build: - sdk env install - ./mvnw -release: +publish: stage: release image: maven:3 rules: @@ -51,10 +51,19 @@ release: - export REPOSITORY="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/maven" - export ALT_REPOSITORY="altDeploymentRepository=gitlab::default::${REPOSITORY}" - export IMG_REGISTRY="${CI_REGISTRY}/jaguililla/hexagonal_spring" - - export POM_VERSION="$(mvn help:evaluate -D expression=project.version -q -D forceStdout)" - ./mvnw -s ci_settings.xml -D ${ALT_REPOSITORY} -D image.registry=${IMG_REGISTRY} -D spring-boot.build-image.publish=true -B deploy - rm -rf "${CLIENT_PATH}/src/main/java/${CONTROLLERS_PATH}" - mvn -s ci_settings.xml -f "${CLIENT_PATH}/pom.xml" -B -D ${ALT_REPOSITORY} clean deploy + +release: + stage: release + image: registry.gitlab.com/gitlab-org/release-cli:latest + dependencies: + - publish + rules: + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + script: + - export POM_VERSION="$(mvn help:evaluate -D expression=project.version -q -D forceStdout)" release: tag_name: ${POM_VERSION} description: Release ${POM_VERSION}