diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 59ebe955d..280b44e87 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}-${GITHUB_SHA::8}-$(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}-${GITHUB_SHA::8}-$(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 6116c6e55..6c30da086 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -64,6 +64,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + fetch-depth: 0 - uses: actions/setup-java@v2 with: java-version: 11 @@ -73,8 +75,10 @@ jobs: id: build_variables run: | echo ::set-output name=REPO::${GITHUB_REPOSITORY##*/} - echo ::set-output name=VERSION::"${GITHUB_SHA::8}-$(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-${GITHUB_SHA::8}-$(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 $GRADLE_ARGS - name: Build slim container image diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7fa047f29..297d34e8c 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