-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #865 from Anselmoo/Anselmoo/issue861
ci: 🏗️ Update Doc-Release
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ on: | |
release: | ||
types: | ||
- published | ||
workflow_dispatch: | ||
|
||
jobs: | ||
Changelog-Update: | ||
|
@@ -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 }}' | ||
|
@@ -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 }}" | ||
|