mirror of https://github.com/abpframework/abp.git
csharpabpc-sharpframeworkblazoraspnet-coredotnet-coreaspnetcorearchitecturesaasdomain-driven-designangularmulti-tenancy
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
129 lines
3.9 KiB
129 lines
3.9 KiB
name: Update ABP Studio Docs
|
|
|
|
on:
|
|
repository_dispatch:
|
|
types: [update_studio_docs]
|
|
|
|
jobs:
|
|
update-docs:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
|
|
steps:
|
|
- name: Read payload
|
|
run: |
|
|
echo "Version: ${{ github.event.client_payload.version }}"
|
|
echo "Target branch: ${{ github.event.client_payload.target_branch }}"
|
|
|
|
- name: Checkout dev
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: dev
|
|
fetch-depth: 0
|
|
|
|
- name: Configure git
|
|
run: |
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
|
|
- name: Create working branch
|
|
run: |
|
|
VERSION="${{ github.event.client_payload.version }}"
|
|
BRANCH="docs/studio-${VERSION}"
|
|
git checkout -B "$BRANCH"
|
|
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
|
|
|
|
# -----------------------------
|
|
# Update release-notes.md
|
|
# -----------------------------
|
|
- name: Update release-notes.md
|
|
run: |
|
|
FILE="docs/en/studio/release-notes.md"
|
|
VERSION="${{ github.event.client_payload.version }}"
|
|
|
|
mkdir -p docs/en/studio
|
|
|
|
if [ ! -f "$FILE" ]; then
|
|
echo "# Release Notes" > "$FILE"
|
|
echo "" >> "$FILE"
|
|
fi
|
|
|
|
if ! grep -q "## Version $VERSION" "$FILE"; then
|
|
{
|
|
echo "## Version $VERSION"
|
|
echo ""
|
|
echo "- Documentation updated for ABP Studio $VERSION"
|
|
echo ""
|
|
echo "---"
|
|
echo ""
|
|
} > temp.md
|
|
|
|
cat temp.md "$FILE" > "$FILE.new"
|
|
mv "$FILE.new" "$FILE"
|
|
rm temp.md
|
|
else
|
|
echo "Release notes already contain $VERSION, skipping"
|
|
fi
|
|
|
|
# -----------------------------
|
|
# Update version-mapping.md
|
|
# -----------------------------
|
|
- name: Update version-mapping.md
|
|
run: |
|
|
FILE="docs/en/studio/version-mapping.md"
|
|
VERSION="${{ github.event.client_payload.version }}"
|
|
|
|
mkdir -p docs/en/studio
|
|
|
|
if [ ! -f "$FILE" ]; then
|
|
echo "| Studio Version | ABP Version |" > "$FILE"
|
|
echo "|---------------|-------------|" >> "$FILE"
|
|
fi
|
|
|
|
if ! grep -q "| $VERSION |" "$FILE"; then
|
|
echo "| $VERSION | dev |" >> "$FILE"
|
|
else
|
|
echo "Version mapping already exists, skipping"
|
|
fi
|
|
|
|
# ⭐ KRİTİK: değişiklik var mı kontrol et
|
|
- name: Check for changes
|
|
id: changes
|
|
run: |
|
|
git add docs/en/studio
|
|
if git diff --cached --quiet; then
|
|
echo "has_changes=false" >> $GITHUB_OUTPUT
|
|
echo "No documentation changes detected"
|
|
else
|
|
echo "has_changes=true" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- name: Commit changes
|
|
if: steps.changes.outputs.has_changes == 'true'
|
|
run: |
|
|
git commit -m "docs(studio): update docs for ${{ github.event.client_payload.version }}"
|
|
|
|
- name: Push branch
|
|
if: steps.changes.outputs.has_changes == 'true'
|
|
run: |
|
|
git push -u origin "$BRANCH"
|
|
|
|
- name: Create PR
|
|
if: steps.changes.outputs.has_changes == 'true'
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
run: |
|
|
gh pr create \
|
|
--title "docs(studio): release ${{ github.event.client_payload.version }}" \
|
|
--body "Automated documentation update for ABP Studio ${{ github.event.client_payload.version }}" \
|
|
--base "${{ github.event.client_payload.target_branch }}" \
|
|
--head "$BRANCH"
|
|
|
|
- name: Enable auto-merge
|
|
if: steps.changes.outputs.has_changes == 'true'
|
|
env:
|
|
GH_TOKEN: ${{ secrets.BOT_SECRET }}
|
|
run: |
|
|
gh pr merge "$BRANCH" --squash --auto
|
|
|