Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HPCC-30890 Changelog automation to build-assets workflow #19219

Open
wants to merge 1 commit into
base: candidate-9.8.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions .github/workflows/build-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This repo should be relocated to hpccsystems (could open a Jira for this?)

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/[email protected]
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
Loading