diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 27016b9d..59c257c2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -204,15 +204,16 @@ jobs: git config --global user.name "${GIT_USERNAME:-github-actions[bot]}" git config --global user.email "${GIT_EMAIL:-github-actions[bot]@users.noreply.github.com}" - name: "Publish" + id: publish timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} run: | - mvn --batch-mode clean package gpg:sign central-publishing:publish release:prepare release:perform \ - -DscmCommentPrefix="[maven-release-plugin][skip ci] " \ - -Dusername=$GIT_USERNAME \ - -Dpassword=$GIT_PASSWORD \ - -Psdk-release \ - -DskipTests=true \ - -Dgpg.passphrase=$GPG_SIGNING_PASSPHRASE \ - -DautoVersionSubmodules=true \ - -DtagNameFormat=@{project.version} \ - -B \ No newline at end of file + mvn --batch-mode clean package gpg:sign central-publishing:publish -P sdk-release -DskipTests=true -Dgpg.passphrase=$GPG_SIGNING_PASSPHRASE + - name: "Create release tag" + if: success() && steps.publish.outcome == 'success' + run: | + VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | sed 's/-SNAPSHOT//') + ARTIFACT_ID=$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout) + git config --global user.name "${GIT_USERNAME:-github-actions[bot]}" + git config --global user.email "${GIT_EMAIL:-github-actions[bot]@users.noreply.github.com}" + git tag "$ARTIFACT_ID"-"$VERSION" + git push origin "$ARTIFACT_ID"-"$VERSION"