Skip to content

Create Release with Updated Docs #5

Create Release with Updated Docs

Create Release with Updated Docs #5

name: Create Release with Updated Docs
on:
workflow_dispatch:
inputs:
tag:
description: 'Release tag (e.g., v0.1.0)'
required: true
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_PAT }}
- name: Set release tag
run: |
echo "RELEASE_TAG=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
- name: Process stubs
run: |
STUB_DIR=".github/docs-stubs"
STUB_FILES=("README.stub.md" "UPDATING.stub.md" "DOCUMENTATION.stub.md")
for stub_file in "${STUB_FILES[@]}"; do
stub_path="$STUB_DIR/$stub_file"
target_file="${stub_file/.stub.md/.md}"
echo "Processing $stub_path → $target_file"
sed "s/\${LATEST_VERSION}/$RELEASE_TAG/g" "$stub_path" > "$target_file"
done
- name: Commit updated docs
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add README.md UPDATING.md DOCUMENTATION.md
git commit -m "Update docs for release $RELEASE_TAG" || echo "No changes to commit"
git push origin main
- name: Create GitHub release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GH_PAT }}
tag: ${{ env.RELEASE_TAG }}
name: Release ${{ env.RELEASE_TAG }}
body: 'Automated release including updated docs'