diff --git a/.github/workflows/jacoco_report.yml b/.github/workflows/jacoco_report.yml index ff49512e..80f08b2f 100644 --- a/.github/workflows/jacoco_report.yml +++ b/.github/workflows/jacoco_report.yml @@ -24,7 +24,7 @@ on: env: scalaLong: 2.13.11 scalaShort: "2.13" - coverage-overall: 60.0 + coverage-overall: 58.0 coverage-changed-files: 80.0 check-overall-coverages: true diff --git a/.github/workflows/release_draft.yml b/.github/workflows/release_draft.yml index aef2e423..1df41308 100644 --- a/.github/workflows/release_draft.yml +++ b/.github/workflows/release_draft.yml @@ -29,39 +29,40 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Validate format of received tag - uses: actions/github-script@v7 - with: - script: | - const newTag = core.getInput('tag-name'); - const regex = /^v[0-9]+\.[0-9]+\.[0-9]+$/; - - if (!regex.test(newTag)) { - core.setFailed('Tag does not match the required format "v[0-9]+.[0-9]+.[0-9]+"'); - return; - } - - // get all tags - const { data: refs } = await github.rest.git.listMatchingRefs({ - owner: context.repo.owner, - repo: context.repo.repo, - ref: 'tags/' - }); - - const latestTag = refs.sort((a, b) => new Date(b.object.date) - new Date(a.object.date))[0].ref.replace('refs/tags/', ''); - const latestVersion = latestTag.replace('v', '').split('.').map(Number); - const newVersion = newTag.replace('v', '').split('.').map(Number); - - // check tag's correct version increase - const isValidVersion = (latestVersion[0] === newVersion[0] && latestVersion[1] === newVersion[1] && newVersion[2] === latestVersion[2] + 1) || - (latestVersion[0] === newVersion[0] && newVersion[1] === latestVersion[1] + 1 && newVersion[2] === 0) || - (newVersion[0] === latestVersion[0] + 1 && newVersion[1] === 0 && newVersion[2] === 0); - - if (!isValidVersion) { - core.setFailed('New tag is not one version higher than the latest tag'); - return; - } - tag-name: ${{ github.event.inputs.tagName }} + # the following step is disabled because it doesn't order the version tags correctly +# - name: Validate format of received tag +# uses: actions/github-script@v7 +# with: +# script: | +# const newTag = core.getInput('tag-name'); +# const regex = /^v[0-9]+\.[0-9]+\.[0-9]+$/; +# +# if (!regex.test(newTag)) { +# core.setFailed('Tag does not match the required format "v[0-9]+.[0-9]+.[0-9]+"'); +# return; +# } +# +# // get all tags +# const { data: refs } = await github.rest.git.listMatchingRefs({ +# owner: context.repo.owner, +# repo: context.repo.repo, +# ref: 'tags/' +# }); +# +# const latestTag = refs.sort((a, b) => new Date(b.object.date) - new Date(a.object.date))[0].ref.replace('refs/tags/', ''); +# const latestVersion = latestTag.replace('v', '').split('.').map(Number); +# const newVersion = newTag.replace('v', '').split('.').map(Number); +# +# // check tag's correct version increase +# const isValidVersion = (latestVersion[0] === newVersion[0] && latestVersion[1] === newVersion[1] && newVersion[2] === latestVersion[2] + 1) || +# (latestVersion[0] === newVersion[0] && newVersion[1] === latestVersion[1] + 1 && newVersion[2] === 0) || +# (newVersion[0] === latestVersion[0] + 1 && newVersion[1] === 0 && newVersion[2] === 0); +# +# if (!isValidVersion) { +# core.setFailed('New tag is not one version higher than the latest tag'); +# return; +# } +# tag-name: ${{ github.event.inputs.tagName }} - name: Create and push tag uses: actions/github-script@v7 @@ -107,7 +108,7 @@ jobs: ref: refs/tags/${{ github.event.inputs.tagName }} - name: Generate release notes id: generate_release_notes - uses: AbsaOSS/generate-release-notes@v0.2.0 + uses: AbsaOSS/generate-release-notes@feature/55-Chapter-line-formatting-authors env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: @@ -118,8 +119,16 @@ jobs: {"title": "New Features 🎉", "label": "enhancement"}, {"title": "Bugfixes 🛠", "label": "bug"} ] + duplicity-scope: 'service' + duplicity-icon: '🔁' warnings: true - skip-release-notes: "no RN" + skip-release-notes-label: "no RN" + print-empty-chapters: false + chapters-to-pr-without-issue: true + row-format-issue: '#_{title}_ {developed-by} {co-authored-by} in $number' + row-format-pr: '#_{title}_ {developed-by} {co-authored-by} in $number' + row-format-link-pr: true + - name: Create draft release uses: softprops/action-gh-release@v1 env: diff --git a/.github/workflows/release_notes_comments_copy_from_pr_to_linked_issues.yml b/.github/workflows/release_notes_comments_copy_from_pr_to_linked_issues.yml deleted file mode 100644 index 71226824..00000000 --- a/.github/workflows/release_notes_comments_copy_from_pr_to_linked_issues.yml +++ /dev/null @@ -1,111 +0,0 @@ -# -# Copyright 2021 ABSA Group Limited -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -name: Release Notes Comments Copy from PR to Linked Issues - -on: - pull_request: - types: [closed] - branches: [ master ] - -jobs: - copy_release_notes: - if: github.event.pull_request.merged == true - name: Copy Release Notes - runs-on: ubuntu-latest - steps: - - name: Fetch PR Comments - id: get-comments - uses: actions/github-script@v7 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - const prNumber = context.payload.pull_request.number; - const repoName = context.repo.repo; - const repoOwner = context.repo.owner; - const releaseNotesRegex = /release notes?:?/i; - - const comments = await github.rest.issues.listComments({ - owner: repoOwner, - repo: repoName, - issue_number: prNumber, - }); - - const releaseNoteComment = comments.data.find(comment => releaseNotesRegex.test(comment.body)); - const releaseNoteBody = releaseNoteComment ? releaseNoteComment.body : ''; - console.log(`Release Note Body: ${releaseNoteBody}`); - core.setOutput('releaseNoteBody', releaseNoteBody); - - - name: Print Extracted releaseNoteBody - run: | - echo "Extracted Release Note Body:" - echo "${{ steps.get-comments.outputs.releaseNoteBody }}" - echo "RELEASE_NOTE_BODY<> $GITHUB_ENV - echo "${{ steps.get-comments.outputs.releaseNoteBody }}" >> $GITHUB_ENV - echo "EOF" >> $GITHUB_ENV - - - name: Parse PR Description for Related Issues - id: find-issues - uses: actions/github-script@v7 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - const description = context.payload.pull_request.body; - const issueNumbers = []; - const regexPattern = /([Cc]los(e|es|ed)|[Ff]ix(es|ed)?|[Rr]esolv(e|es|ed))\s*#\s*([0-9]+)/g; - - let match; - while ((match = regexPattern.exec(description)) !== null) { - // This is necessary to avoid infinite loops with zero-width matches - if (match.index === regexPattern.lastIndex) { - regexPattern.lastIndex++; - } - - // The actual issue number is in the last group of the match - const issueNumber = match[match.length - 1]; - if (issueNumber) { - issueNumbers.push(issueNumber); - } - } - - core.setOutput('issueNumbers', issueNumbers.join(', ')); - - - name: Print Extracted Issue Numbers - run: | - echo "Extracted Issue Numbers: ${{ steps.find-issues.outputs.issueNumbers }}" - echo "ISSUE_NUMBERS=${{ steps.find-issues.outputs.issueNumbers }}" >> $GITHUB_ENV - - - name: Post Comment to Issues - if: ${{ (steps.get-comments.outputs.releaseNoteBody) && (steps.find-issues.outputs.issueNumbers) }} - uses: actions/github-script@v7 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - const issueNumbers = process.env.ISSUE_NUMBERS; - const commentBody = process.env.RELEASE_NOTE_BODY; - const repoName = context.repo.repo; - const repoOwner = context.repo.owner; - - for (const issueNumber of issueNumbers.split(', ')) { - if (issueNumber && commentBody) { - await github.rest.issues.createComment({ - owner: repoOwner, - repo: repoName, - issue_number: issueNumber, - body: commentBody - }); - } - }