Skip to content

Commit

Permalink
Merge pull request #865 from Anselmoo/Anselmoo/issue861
Browse files Browse the repository at this point in the history
ci: 🏗️ Update Doc-Release
  • Loading branch information
Anselmoo authored Jul 2, 2023
2 parents 8b880b7 + 7cbc88a commit 2530212
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/update-changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
release:
types:
- published
workflow_dispatch:

jobs:
Changelog-Update:
Expand All @@ -27,6 +28,17 @@ jobs:
commit_message: Update CHANGELOG
file_pattern: CHANGELOG.md
create_branch: true
# Create Pull Request
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "docs: :memo: Update CHANGELOG for ${{ github.event.release.tag_name }}"
title: "docs: :memo: Update CHANGELOG for ${{ github.event.release.tag_name }}"
body: |
This Pull Request was automatically created by the Changelog Updater Action.
It updates the CHANGELOG.md with the release notes from the latest release.
Release-Documentation:
if: ${{ contains(github.event.release.prerelease, false) }}
name: Build Documentation from new release branch 'release/${{ github.event.release.tag_name }}'
Expand Down Expand Up @@ -54,6 +66,28 @@ jobs:
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
- name: Fetch tags
run: git fetch --tags --prune --unshallow
- name: Get previous tag
id: prev_tag
run: echo "::set-output name=prev_tag::$(git rev-list --tags --skip=1 --max-count=1)"
- name: Get latest tag
id: latest_tag
run: echo "::set-output name=latest_tag::$(git rev-list --tags --max-count=1)"
- name: Check if release is minor
id: is_minor
run: |
current_tag=${{ github.event.release.tag_name }}
prev_tag=${{ steps.prev_tag.outputs.prev_tag }}
latest_tag=$(git describe --tags --abbrev=0 ${{ steps.latest_tag.outputs.latest_tag }})
if [[ $current_tag =~ ^${latest_tag%.*}\.[0-9]+$ && $prev_tag =~ ^${latest_tag%.*}\.[0-9]+\.[0-9]+$ ]]; then
echo "::set-output name=is_minor::true"
else
echo "::set-output name=is_minor::false"
fi
- name: Delete previous documentation
if: steps.is_minor.outputs.is_minor == 'true'
run: poetry run mike delete --version ${{ steps.prev_tag.outputs.prev_tag }}
- name: Deploy documentation develops
run: |
poetry run mike deploy --push --rebase --update-aliases ${{ github.event.release.tag_name }} latest --message "Release ${{ github.event.release.tag_name }}"
Expand Down

0 comments on commit 2530212

Please sign in to comment.