From 05161d7f904b5e6b12cc7440fecb579202d7cbba Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Thu, 29 Aug 2024 09:08:07 +1000 Subject: [PATCH] [#1212] Added support for `CalVer` scheme when generating release notes. (#1382) --- .github/workflows/draft-release-notes.yml | 12 ++++++++++++ docs/releasing.md | 17 ++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/.github/workflows/draft-release-notes.yml b/.github/workflows/draft-release-notes.yml index 5ae482c94..3a4d5945b 100644 --- a/.github/workflows/draft-release-notes.yml +++ b/.github/workflows/draft-release-notes.yml @@ -19,7 +19,19 @@ jobs: runs-on: ubuntu-latest steps: + - name: Generate CalVer version + if: env.DREVOPS_RELEASE_VERSION_SCHEME == 'calver' + id: calver + run: | + export VERSION="$(date "+%y.%-m").0" + echo "version=${VERSION}" >> "${GITHUB_OUTPUT}" + echo "Version set to ${VERSION}" + - name: Draft release notes uses: release-drafter/release-drafter@v6 + with: + tag: ${{ steps.calver.outputs.version || github.ref_name }} + name: ${{ steps.calver.outputs.version || github.ref_name }} + version: ${{ steps.calver.outputs.version || github.ref_name }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/docs/releasing.md b/docs/releasing.md index 33597faf6..56868d271 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -21,7 +21,7 @@ Refer to https://docs.drevops.com/latest/usage/release for more information. 6. The hash of the `HEAD` of the `production` branch matches the hash of the `HEAD` of `master` branch. -## Version Number +## Version Number - Semantic Versioning Release versions are numbered according to [Semantic Versioning](https://semver.org/). @@ -35,3 +35,18 @@ Examples: * Correct: `0.1.0`, `1.0.0` , `1.0.1` , `1.0.10` * Incorrect: `0.1` , `1` , `1.0` , `1.0.01` , `1.0.010` + +## Version Number - CalVer + +Release versions are numbered according to [CalVer Versioning](https://calver.org/). + +Given a version number `YY.M.Z`: + +* `YY` = Short year. No leading zeroes. +* `M` = Short month. No leading zeroes. +* `Z` = Hotfix/patch version. No leading zeroes. + +Examples: + +* Correct: `24.1.0`, `24.11.1` , `24.1.10`, `24.0.1`, `9.12.0` +* Incorrect: `24.0.0`, `2024.1.1` , `24` , `24.1.00` , `24.01.0` , `01.1.0`