diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 1d3ba5d040e..bdc16bc0a95 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -42,6 +42,22 @@ jobs: - name: restore_gosum run: echo "${{needs.gomod.outputs.gosum}}" > go.sum - run: make golint + + reno_lint: + runs-on: ubuntu-20.04 + needs: gomod + steps: + - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + with: + fetch-depth: 0 + - name: reset_git_extension + run: git config --unset-all extensions.worktreeconfig + - name: reno_lint + run: make reno-lint + ## Reno lint does not catch some errors which make reno report fail + - name: reno_report_check + run: make reno-report + test: runs-on: ubuntu-20.04 needs: gomod diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 0946210d9da..0f6e6072790 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -32,6 +32,7 @@ jobs: export CURRENT_TAG=$(git describe --abbrev=0 --tags) echo ./build/bump_version.sh "${CURRENT_TAG}" "${RELEASE_TAG}" ./build/bump_version.sh "${CURRENT_TAG}" "${RELEASE_TAG}" + make reno-report VERSION="${RELEASE_TAG}" - name: commit_changes run: | git config --global user.name 'Kasten Production' @@ -39,10 +40,18 @@ jobs: git checkout -B "kan-docs-${PRERELEASE_DOCS_BRANCH}-${RELEASE_TAG}" git add -A git commit -s -m "pre-release: Update version to ${RELEASE_TAG}" + - name: push_changes + run: git push origin "kan-docs-${PRERELEASE_DOCS_BRANCH}-${RELEASE_TAG}" + - name: create_pr_body + run: | + echo "Update version to ${RELEASE_TAG}" > PR_BODY_FILE + echo "" >> PR_BODY_FILE + echo "Please check the changelog for the following merges:" >> PR_BODY_FILE + export CURRENT_TAG=$(git describe --abbrev=0 --tags) + git log ${CURRENT_TAG}..kan-docs-${PRERELEASE_DOCS_BRANCH}-${RELEASE_TAG} --pretty="- %h: %s" | grep -v ': test' | grep -v ': doc' | grep -v ': build' | grep -v ': deps' >> PR_BODY_FILE - name: create_pr run: | - git push origin "kan-docs-${PRERELEASE_DOCS_BRANCH}-${RELEASE_TAG}" - gh pr create --title "pre-release: Update version to ${RELEASE_TAG}" --body "Update version to ${RELEASE_TAG}" --head "kan-docs-${PRERELEASE_DOCS_BRANCH}-${RELEASE_TAG}" --base master --reviewer tdmanv,pavannd1,viveksinghggits --label kueue + gh pr create --title "pre-release: Update version to ${RELEASE_TAG}" -F PR_BODY_FILE --head "kan-docs-${PRERELEASE_DOCS_BRANCH}-${RELEASE_TAG}" --base master --reviewer tdmanv,pavannd1,viveksinghggits,hairyhum --label kueue env: GH_TOKEN: ${{ secrets.GH_TOKEN }} diff --git a/.gitignore b/.gitignore index 83f5ed09b03..59a2369067d 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,6 @@ /dist **/*.swp /.idea -/releasenotes/config.yaml \ No newline at end of file +/releasenotes/config.yaml +CHANGELOG.rst +CHANGELOG_CURRENT.rst \ No newline at end of file diff --git a/Makefile b/Makefile index 024e2c35efe..d80ee8af21d 100644 --- a/Makefile +++ b/Makefile @@ -292,4 +292,7 @@ reno-new: @$(MAKE) run CMD="reno new $(note)" reno-report: - @$(MAKE) run CMD="./build/reno_report.sh $(VERSION)" \ No newline at end of file + @$(MAKE) run CMD="./build/reno_report.sh $(VERSION)" + +reno-lint: + @$(MAKE) run CMD="reno lint" \ No newline at end of file diff --git a/build/gorelease.sh b/build/gorelease.sh index 61ca8fd15d5..52eeca322ad 100755 --- a/build/gorelease.sh +++ b/build/gorelease.sh @@ -26,6 +26,9 @@ then exit 1 fi +## Set default changelog file +CHANGELOG_FILE=${CHANGELOG_FILE:-./CHANGELOG_CURRENT.md} + RELEASE_NOTES="" if [ -n "${CHANGELOG_FILE:-}" ] then diff --git a/build/reno_report.sh b/build/reno_report.sh index 7dc2ca2ef72..e478548ed1a 100755 --- a/build/reno_report.sh +++ b/build/reno_report.sh @@ -37,8 +37,11 @@ rst2md ./CHANGELOG.rst --output ./CHANGELOG.md ## It will be replaced by `unreleased_version_title` setting in the actual report file UNRELEASED_VERSION=$(reno list 2>/dev/null | grep -E "^[0-9]+\.[0-9]+\.[0-9]+\-[0-9]+") -## Generate rst report -echo reno report --version=${UNRELEASED_VERSION} --output ./CHANGELOG_CURRENT.rst -reno report --version=${UNRELEASED_VERSION} --output ./CHANGELOG_CURRENT.rst -## Convert rst to markdown -rst2md ./CHANGELOG_CURRENT.rst --output ./CHANGELOG_CURRENT.md +if [ -n "${UNRELEASED_VERSION}" ] +then + ## Generate rst report + echo reno report --version=${UNRELEASED_VERSION} --output ./CHANGELOG_CURRENT.rst + reno report --version=${UNRELEASED_VERSION} --output ./CHANGELOG_CURRENT.rst + ## Convert rst to markdown + rst2md ./CHANGELOG_CURRENT.rst --output ./CHANGELOG_CURRENT.md +fi