From cb628294086b34219b2025982360f0c7ab9a3dc2 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Wed, 27 Mar 2024 05:36:34 +0000 Subject: [PATCH] build(chart): attach commit hash into chart release notes Signed-off-by: Viet Nguyen Duc --- .github/workflows/deploy.yml | 6 ++++++ generate_chart_changelog.sh | 12 ++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c7a5f3fa4..82ee2a4b5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -82,6 +82,12 @@ jobs: timeout_minutes: 20 max_attempts: 3 command: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} PUSH_IMAGE=true make tag_and_push_browser_images + - name: Delete previous nightly tag & release if any + uses: dev-drprasad/delete-tag-and-release@master + with: + tag_name: nightly + github_token: ${{ secrets.GITHUB_TOKEN }} + delete_release: true - name: Commit files run: | git config --local user.email "selenium-ci@users.noreply.github.com" diff --git a/generate_chart_changelog.sh b/generate_chart_changelog.sh index 152c06f2a..774f108a9 100755 --- a/generate_chart_changelog.sh +++ b/generate_chart_changelog.sh @@ -38,12 +38,12 @@ generate_changelog() { # Get the changes for each section (Added, Removed, Fixed, Changed) image_tag_changes=$(echo "Chart is using image tag $CHART_APP_VERSION" | sed -e 's/^/- /') - k8s_versions_tested=$(echo "Chart is tested on Kubernetes versions: $(cat .github/workflows/helm-chart-test.yml | grep -oP "k8s-version: '\Kv.*(?=')" | tr '\n' ' ')" | sed -e 's/^/- /') - helm_versions_tested=$(echo "Chart is tested on Helm versions: $(cat .github/workflows/helm-chart-test.yml | grep -oP "helm-version: '\Kv.*(?=')" | tr '\n' ' ')" | sed -e 's/^/- /') - added_changes=$(git log --pretty=format:"%s :: %an" "$commit_range" -- "$CHART_DIR" | grep -iE "^feat|^add" | sed -e 's/^/- /') - removed_changes=$(git log --pretty=format:"%s :: %an" "$commit_range" -- "$CHART_DIR" | grep -iE "^remove|^deprecate|^delete" | sed -e 's/^/- /') - fixed_changes=$(git log --pretty=format:"%s :: %an" "$commit_range" -- "$CHART_DIR" | grep -iE "^fix|^bug" | sed -e 's/^/- /') - changed_changes=$(git log --pretty=format:"%s :: %an" "$commit_range" -- "$CHART_DIR" | grep -iEv "^feat|^add|^remove|^deprecate|^delete|^fix|^bug" | sed -e 's/^/- /') + k8s_versions_tested=$(echo "Chart is tested on Kubernetes versions: $(cat .github/workflows/helm-chart-test.yml | grep -oP "k8s-version: '\Kv.*(?=')" | tr '\n' ',' | sed s/,/,\ /g)" | sed -e 's/^/- /') + helm_versions_tested=$(echo "Chart is tested on Helm versions: $(cat .github/workflows/helm-chart-test.yml | grep -oP "helm-version: '\Kv.*(?=')" | tr '\n' ',' | sed s/,/,\ /g)" | sed -e 's/^/- /') + added_changes=$(git log --pretty=format:"[\`%h\`](http://github.com/seleniumhq/docker-selenium/commit/%H) - %s :: %an" "$commit_range" -- "$CHART_DIR" | grep -iE "\- feat|\- add" | sed -e 's/^/- /') + removed_changes=$(git log --pretty=format:"[\`%h\`](http://github.com/seleniumhq/docker-selenium/commit/%H) - %s :: %an" "$commit_range" -- "$CHART_DIR" | grep -iE "\- remove|\- deprecate|\- delete" | sed -e 's/^/- /') + fixed_changes=$(git log --pretty=format:"[\`%h\`](http://github.com/seleniumhq/docker-selenium/commit/%H) - %s :: %an" "$commit_range" -- "$CHART_DIR" | grep -iE "\- fix|\- bug" | sed -e 's/^/- /') + changed_changes=$(git log --pretty=format:"[\`%h\`](http://github.com/seleniumhq/docker-selenium/commit/%H) - %s :: %an" "$commit_range" -- "$CHART_DIR" | grep -iEv "\- feat|\- add|\- remove|\- deprecate|\- delete|\- fix|\- bug" | sed -e 's/^/- /') # Create a temporary file temp_file=$(mktemp)