ci: use github custom action
parent
8341416ee0
commit
7d57857a1f
|
@ -50,35 +50,17 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
ansible-galaxy collection build .
|
ansible-galaxy collection build .
|
||||||
|
|
||||||
- name: Scan PR merges from latest tag
|
- name: Create changelog and documentation
|
||||||
run: |
|
uses: ansible-middleware/collection-docs-action@main
|
||||||
TYPES=("minor_changes" "major_changes" "bugfixes" "deprecated_features" "removed_features" "breaking_changes")
|
with:
|
||||||
TAG=$(git describe --abbrev=0 --tags)
|
collection_fqcn: middleware_automation.keycloak
|
||||||
PRS=($(comm -12 <(git log --oneline ${TAG}.. --format="tformat:%H" | sort ) <(hub pr list -s all -f '%sm%n' --color=never | sort )))
|
collection_repo: ansible-middleware/keycloak
|
||||||
IFS=$'\n' FRAGMENTS=($(hub pr list -s all -f '%sm~%I~%L~%t~%n' --color=never| grep -P "$(echo "^(${PRS[@]})" | tr ' ' '|')"))
|
dependencies: false
|
||||||
for frag in "${FRAGMENTS[@]}"; do
|
commit_changelog: true
|
||||||
PR=$(echo $frag|cut -d~ -f2)
|
commit_ghpages: false
|
||||||
type="$(echo $frag|cut -d~ -f3)"
|
changelog_release: true
|
||||||
msg="$(echo $frag|cut -d~ -f4|sed 's/`/``/g')"
|
generate_docs: false
|
||||||
if [[ "$type" != "" && "${TYPES[*]}" =~ "${type}" ]]; then
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
echo -e "$type:\n - >\n $msg \`#${PR} <https://github.com/ansible-middleware/keycloak/pull/${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: Publish collection
|
- name: Publish collection
|
||||||
env:
|
env:
|
||||||
|
|
Loading…
Reference in New Issue