diff --git a/.github/workflows/build-assets.yml b/.github/workflows/build-assets.yml index 4babda36283..4ae215dd064 100644 --- a/.github/workflows/build-assets.yml +++ b/.github/workflows/build-assets.yml @@ -40,11 +40,15 @@ jobs: candidate_branch: ${{ steps.vars.outputs.candidate_branch }} cmake_docker_config: ${{ steps.vars.outputs.cmake_docker_config }} gpg_import: ${{ steps.vars.outputs.gpg_import }} + folder_prettygitlogs: ${{ steps.vars.outputs.folder_prettygitlogs }} + folder_eclide: ${{ steps.vars.outputs.folder_eclide }} steps: - name: Calculate vars id: vars run: | echo "folder_platform=${{ github.workspace }}/HPCC-Platform" >> $GITHUB_OUTPUT + echo "folder_eclide"=${{ github.workspace }}/ECLIDE >> $GITHUB_OUTPUT + echo "folder_prettygitlogs"=${{ github.workspace }}/PrettyGitLogs >> $GITHUB_OUTPUT echo 'mount_platform=source="${{ github.workspace }}/HPCC-Platform",target=/hpcc-dev/HPCC-Platform,type=bind,consistency=cached' >> $GITHUB_OUTPUT echo "folder_ln=${{ github.workspace }}/LN" >> $GITHUB_OUTPUT echo 'mount_ln=source="${{ github.workspace }}/LN",target=/hpcc-dev/LN,type=bind,consistency=cached' >> $GITHUB_OUTPUT @@ -695,3 +699,111 @@ jobs: with: name: windows-2022-logs path: ./ECLIDE/build/**/*.log + + + changelogs: + name: Generate Changelogs + needs: preamble + runs-on: ubuntu-latest + steps: + - name: Checkout HPCC-Platform + uses: actions/checkout@v4 + with: + ref: ${{ needs.preamble.outputs.community_ref }} + submodules: recursive + path: ${{ needs.preamble.outputs.folder_platform }} + fetch-tags: true + fetch-depth: 0 + - name: Checkout LN + uses: actions/checkout@v4 + with: + repository: ${{ github.repository_owner }}/LN + token: ${{ secrets.LNB_TOKEN }} + ref: ${{ needs.preamble.outputs.internal_ref }} + submodules: recursive + path: ${{ needs.preamble.outputs.folder_ln }} + fetch-tags: true + fetch-depth: 0 + - name: Checkout ECLIDE + uses: actions/checkout@v4 + with: + repository: ${{ github.repository_owner }}/ECLIDE + ref: ${{ needs.preamble.outputs.eclide_ref }} + submodules: recursive + path: ${{ needs.preamble.outputs.folder_eclide }} + fetch-tags: true + fetch-depth: 0 + - name: Checkout PrettyGitLogs + uses: actions/checkout@v4 + with: + repository: gfortil/PrettyGitLogs + ref: master + path: ${{ needs.preamble.outputs.folder_prettygitlogs }} + - name: Get Previous Versions + id: get_version + shell: bash + working-directory: ${{ needs.preamble.outputs.folder_platform }} + run: | + tag=$(git describe --exact-match --tags 2>/dev/null) + version=$(echo $tag | cut -d_ -f2) + major=$(echo $version | cut -d. -f1) + minor=$(echo $version | cut -d. -f2) + point=$(echo $version | cut -d. -f3 | cut -d- -f1) + type=$(echo $version | cut -d- -f2) + if [[ $point -eq 0 ]]; then + if [[ $minor -eq 0 ]]; then + major=$((major - 1)) + previous_rc=$(git tag --create-reflog --sort=-v:refname | grep -E "^community_$major\.[0-9]*\.[0-9]*-rc" | head -n 1 | cut -d_ -f2 ) + previous_gold=$(git tag --create-reflog --sort=-v:refname | grep -E "^community_$major\.[0-9]*\.[0-9]*-[0-9]" | head -n 1 | cut -d_ -f2 ) + else + minor=$((minor - 2)) + previous_rc=$(git tag --create-reflog --sort=-v:refname | grep -E "^community_$major\.$minor\.[0-9]*-rc" | head -n 1 | cut -d_ -f2 ) + previous_gold=$(git tag --create-reflog --sort=-v:refname | grep -E "^community_$major\.$minor\.[0-9]*-[0-9]" | head -n 1 | cut -d_ -f2 ) + fi + else + point=$((point - 2)) + previous_rc=$(git tag --create-reflog --sort=-v:refname | grep -E "^community_$major\.$minor\.$point-rc" | head -n 1 | cut -d_ -f2 ) + previous_gold=$(git tag --create-reflog --sort=-v:refname | grep -E "^community_$major\.$minor\.$point-[0-9]" | head -n 1 | cut -d_ -f2) + fi + echo "current_version=$version" >> $GITHUB_OUTPUT + echo "previous_rc_version=$previous_rc" >> $GITHUB_OUTPUT + echo "previous_gold_version=$previous_gold" >> $GITHUB_OUTPUT + echo "type=$type" >> $GITHUB_OUTPUT + - name: Print vars + run: | + echo "${{ toJSON(steps.get_version.outputs) }}" + - name: Generate Changelogs + shell: bash + working-directory: ${{ needs.preamble.outputs.folder_prettygitlogs }} + run: | + # run setup for perl environment + ./prettyLogs_setup.sh + + # provide credentials + sed -i -e '/^JIRAUser/c\JIRAUser=${{ secrets.JIRA_USERNAME}}' prettylogs.conf + sed -i -e '/^JIRAPW/c\JIRAPW=${{ secrets.JIRA_TOKEN }}' prettylogs.conf + + # Generate Changelogs + if [[ ! "${{ steps.get_version.outputs.type }}" == *"rc"* ]]; then + perl ./prettyLogs.pl -bt community_${{ steps.get_version.outputs.current_version }} -et community_${{ steps.get_version.outputs.previous_gold_version }} -repo ${{ needs.preamble.outputs.folder_platform }} -sort -html community_${{ steps.get_version.outputs.current_version }} + perl ./prettyLogs.pl -bt internal_${{ steps.get_version.outputs.current_version }} -et internal_${{ steps.get_version.outputs.previous_gold_version }} -repo ${{ needs.preamble.outputs.folder_ln }} -sort -html internal_${{ steps.get_version.outputs.current_version }} + perl ./prettyLogs.pl -bt eclide_${{ steps.get_version.outputs.current_version }} -et eclide_${{ steps.get_version.outputs.previous_gold_version }} -repo ${{ needs.preamble.outputs.folder_eclide }} -sort -html eclide_${{ steps.get_version.outputs.current_version }} + elif [ "${{ steps.get_version.outputs.type }}" == "rc1" ]; then + perl ./prettyLogs.pl -bt community_${{ steps.get_version.outputs.current_version }} -et community_${{ steps.get_version.outputs.previous_gold_version }} -repo ${{ needs.preamble.outputs.folder_platform }} -sort -html community_${{ steps.get_version.outputs.current_version }} + perl ./prettyLogs.pl -bt internal_${{ steps.get_version.outputs.current_version }} -et internal_${{ steps.get_version.outputs.previous_gold_version }} -repo ${{ needs.preamble.outputs.folder_ln }} -sort -html internal_${{ steps.get_version.outputs.current_version }} + perl ./prettyLogs.pl -bt eclide_${{ steps.get_version.outputs.current_version }} -et eclide_${{ steps.get_version.outputs.previous_gold_version }} -repo ${{ needs.preamble.outputs.folder_eclide }} -sort -html eclide_${{ steps.get_version.outputs.current_version }} + else + perl ./prettyLogs.pl -bt community_${{ steps.get_version.outputs.current_version }} -et community_${{ steps.get_version.outputs.previous_rc_version }} -repo ${{ needs.preamble.outputs.folder_platform }} -sort -html community_${{ steps.get_version.outputs.current_version }} + perl ./prettyLogs.pl -bt internal_${{ steps.get_version.outputs.current_version }} -et internal_${{ steps.get_version.outputs.previous_rc_version }} -repo ${{ needs.preamble.outputs.folder_ln }} -sort -html internal_${{ steps.get_version.outputs.current_version }} + perl ./prettyLogs.pl -bt eclide_${{ steps.get_version.outputs.current_version }} -et eclide_${{ steps.get_version.outputs.previous_rc_version }} -repo ${{ needs.preamble.outputs.folder_eclide }} -sort -html eclide_${{ steps.get_version.outputs.current_version }} + fi + - name: Upload Changelogs + uses: ncipollo/release-action@v1.14.0 + with: + allowUpdates: true + generateReleaseNotes: false + prerelease: ${{ contains(github.ref, '-rc') }} + artifacts: | + ${{ needs.preamble.outputs.folder_prettygitlogs }}/community_${{ steps.get_version.outputs.current_version }}.html + ${{ needs.preamble.outputs.folder_prettygitlogs }}/internal_${{ steps.get_version.outputs.current_version }}.html + ${{ needs.preamble.outputs.folder_prettygitlogs }}/eclide_${{ steps.get_version.outputs.current_version }}.html \ No newline at end of file