diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2c018b1d20..0f396a4cd1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,6 +17,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + fetch-depth: 0 - uses: actions/setup-java@v2 with: java-version: 11 @@ -26,7 +28,7 @@ jobs: id: build_variables run: | echo ::set-output name=REPO::${GITHUB_REPOSITORY##*/} - echo ::set-output name=VERSION::"${GITHUB_REF_NAME}-$(git rev-parse --short HEAD)-$(date --utc +'%Y%m%d%H%M')" + echo ::set-output name=VERSION::"$(git describe --tags --abbrev=0 --match="v[0-9]*" | cut -c2-)-dev-${GITHUB_REF_NAME}-$(git rev-parse --short HEAD)-$(date --utc +'%Y%m%d%H%M')" - name: Build env: ORG_GRADLE_PROJECT_version: ${{ steps.build_variables.outputs.VERSION }} diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 3981652a24..41d84a9bcf 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -11,6 +11,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + fetch-depth: 0 - uses: actions/setup-java@v2 with: java-version: 11 @@ -20,8 +22,10 @@ jobs: id: build_variables run: | echo ::set-output name=REPO::${GITHUB_REPOSITORY##*/} - echo ::set-output name=VERSION::"$(git rev-parse --short HEAD)-$(date --utc +'%Y%m%d%H%M')" + echo ::set-output name=VERSION::"$(git describe --tags --abbrev=0 --match="v[0-9]*" | cut -c2-)-dev-pr-$(git rev-parse --short HEAD)-$(date --utc +'%Y%m%d%H%M')" - name: Build + env: + ORG_GRADLE_PROJECT_version: ${{ steps.build_variables.outputs.VERSION }} run: ./gradlew build ${{ steps.build_variables.outputs.REPO }}-web:installDist - name: Build slim container image uses: docker/build-push-action@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 72cbac8739..9aab554ac9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - run: git fetch --prune --unshallow + with: + fetch-depth: 0 - uses: actions/setup-java@v2 with: java-version: 11