From 7d57857a1fb867194a1af6a64ed3569eb1e24a01 Mon Sep 17 00:00:00 2001 From: Guido Grazioli Date: Mon, 9 May 2022 16:00:00 +0200 Subject: [PATCH] ci: use github custom action --- .github/workflows/release.yml | 40 ++++++++++------------------------- 1 file changed, 11 insertions(+), 29 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9a497a9..6704e48 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,35 +50,17 @@ jobs: run: | ansible-galaxy collection build . - - name: Scan PR merges from latest tag - run: | - TYPES=("minor_changes" "major_changes" "bugfixes" "deprecated_features" "removed_features" "breaking_changes") - TAG=$(git describe --abbrev=0 --tags) - PRS=($(comm -12 <(git log --oneline ${TAG}.. --format="tformat:%H" | sort ) <(hub pr list -s all -f '%sm%n' --color=never | sort ))) - IFS=$'\n' FRAGMENTS=($(hub pr list -s all -f '%sm~%I~%L~%t~%n' --color=never| grep -P "$(echo "^(${PRS[@]})" | tr ' ' '|')")) - for frag in "${FRAGMENTS[@]}"; do - PR=$(echo $frag|cut -d~ -f2) - type="$(echo $frag|cut -d~ -f3)" - msg="$(echo $frag|cut -d~ -f4|sed 's/`/``/g')" - if [[ "$type" != "" && "${TYPES[*]}" =~ "${type}" ]]; then - echo -e "$type:\n - >\n $msg \`#${PR} \`_" \ - > changelogs/fragments/${PR}.yaml - fi - done - antsibull-changelog lint -vvv - antsibull-changelog generate - antsibull-changelog release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Commit changelogs - run: | - git config user.name github-actions - git config user.email github-actions@github.com - git diff --minimal --output-indicator-new=' ' -U0 --no-indent-heuristic CHANGELOG.rst | grep "^ "| sed -e 's/`\(#[0-9]\+\) <.*_/\1/g' > gh-release.md - git add CHANGELOG.rst changelogs/changelog.yaml - git commit -m "Update changelog for release ${{ steps.get_version.outputs.TAG_VERSION }}" || true - git push origin + - name: Create changelog and documentation + uses: ansible-middleware/collection-docs-action@main + with: + collection_fqcn: middleware_automation.keycloak + collection_repo: ansible-middleware/keycloak + dependencies: false + commit_changelog: true + commit_ghpages: false + changelog_release: true + generate_docs: false + token: ${{ secrets.GITHUB_TOKEN }} - name: Publish collection env: