Skip to content

fix: update Doxygen input paths to include specific Mainpages directory #58

fix: update Doxygen input paths to include specific Mainpages directory

fix: update Doxygen input paths to include specific Mainpages directory #58

Workflow file for this run

name: Release
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Resolve true commit SHA
id: sha_resolver
run: |
if [[ "${{ github.event_name }}" == "push" ]]; then
ACTUAL_SHA=$(git log --merges --pretty=format:%H -1 | xargs -I{} git show {} --no-patch --format=%P | cut -d' ' -f2)
echo "TRUE_SHA=${ACTUAL_SHA:-${{ github.sha }}}" >> $GITHUB_OUTPUT
else
echo "TRUE_SHA=${{ github.sha }}" >> $GITHUB_OUTPUT
fi
- name: Get PR metadata
uses: 8BitJonny/gh-get-current-pr@3.0.0
id: pr_meta
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
sha: ${{ steps.sha_resolver.outputs.TRUE_SHA }}
- name: Check if PR was squashed
id: check_squash
run: |
PR_COMMITS=$(curl -s \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/${{ github.repository }}/pulls/${{ steps.pr_meta.outputs.number }}/commits" | \
python3 -c "import sys, json; print(len(json.load(sys.stdin)))")
echo "Commit count: $PR_COMMITS"
if [[ "$PR_COMMITS" -eq 1 ]]; then
echo "SQUASH_MERGE=true" >> $GITHUB_ENV
else
echo "SQUASH_MERGE=false" >> $GITHUB_ENV
fi
- name: Get commit messages with SHAs
run: |
if [[ "$SQUASH_MERGE" == "true" ]]; then
response=$(curl -s \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/pulls/${{ steps.pr_meta.outputs.number }}/commits")
echo "$response" \
| python3 -c "import sys, json; d = json.load(sys.stdin)[0]; print(f\"{d['commit']['message']} ({d['sha'][:7]})\")" \
> commits.txt
else
git log --pretty=format:"%s (%h)" ${{ github.event.before }}..${{ github.sha }} \
| grep -v "Merge pull request" \
> commits.txt
fi
- name: Read version from file
id: read_version
run: |
VERSION=$(cat VERSION.txt)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Build release notes file
run: |
echo "## ${{ steps.pr_meta.outputs.pr_title }}" > release_body.md
if [[ -n "${{ steps.pr_meta.outputs.pr_body }}" ]]; then
echo "" >> release_body.md
echo "### Summary" >> release_body.md
echo "${{ steps.pr_meta.outputs.pr_body }}" >> release_body.md
fi
echo "" >> release_body.md
echo "### Changes" >> release_body.md
awk '{print "• " $0}' commits.txt >> release_body.md
echo "" >> release_body.md
echo "### Docker Tags" >> release_body.md
echo "- Stable: [ghcr.io/<github-org>/<image>:${{env.VERSION }}](https://ghcr.io/<github-org>/<image>:${{env.VERSION}})" >> release_body.md
echo "- Major: [ghcr.io/<github-org>/<image>:v${{env.MAJOR}}](https://ghcr.io/<github-org>/<image>:v${{env.MAJOR}})" >> release_body.md
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
tag_name: ${{env.VERSION }}
name: "Release ${{env.VERSION }}"
body_path: release_body.md
draft: false
prerelease: false