From 72a0d0e2e3b4f8b2cfdf52ef5cc12b0c1bbb21ac Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Fri, 13 Dec 2024 12:46:53 -0500 Subject: [PATCH] Fix `actions\build` to use `mvn help:evaluate` Since there is no `revision` property in POM, we cannot use `sed` command to extract project version from the POM. * Use more Maven-friendly `mvn help:evaluate -Dexpression="project.version" -q -DforceStdout` command to get the current project version * Remove tentative `finish_release_tmp.yml` since `actions\build` has been fixed now --- .github/actions/build/action.yml | 2 +- .github/workflows/finish_release_tmp.yml | 29 ------------------------ 2 files changed, 1 insertion(+), 30 deletions(-) delete mode 100644 .github/workflows/finish_release_tmp.yml diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index 5152764..be1f2b7 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -39,6 +39,6 @@ runs: id: read-version shell: bash run: | - version=$(sed -n 's/^.*\(.*\)<\/revision>.*$/\1/p' pom.xml) + version=$(mvn help:evaluate -Dexpression="project.version" -q -DforceStdout) echo "Version is $version" echo "version=$version" >> $GITHUB_OUTPUT diff --git a/.github/workflows/finish_release_tmp.yml b/.github/workflows/finish_release_tmp.yml deleted file mode 100644 index c7582a6..0000000 --- a/.github/workflows/finish_release_tmp.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Finish Release Tmp -on: - workflow_dispatch: - -jobs: - finish-release: - runs-on: ubuntu-latest - steps: - - name: Set up JFrog CLI - uses: jfrog/setup-jfrog-cli@7c95feb32008765e1b4e626b078dfd897c4340ad # v4.1.2 - env: - JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }} - - name: Promote build - run: jfrog rt build-promote spring-retry- 5 libs-release-local - - - name: Check Out Code - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - name: Create GitHub Release - uses: ./.github/actions/create-github-release - with: - milestone: 2.0.11 - token: ${{ secrets.GH_ACTIONS_REPO_TOKEN }} - - - name: Announce Release in Chat - if: env.CHAT_WEBHOOK_URL - run: | - curl -X POST '${{ env.CHAT_WEBHOOK_URL }}' -H 'Content-Type: application/json' -d '{ text: "${{ github.event.repository.name }}-announcing `2.0.11`"}' - env: - CHAT_WEBHOOK_URL: ${{ secrets.SPRING_RELEASE_GCHAT_WEBHOOK_URL }} \ No newline at end of file