Skip to content

Merge pull request #53 from solentlabs/test/dialog-integration #20

Merge pull request #53 from solentlabs/test/dialog-integration

Merge pull request #53 from solentlabs/test/dialog-integration #20

Workflow file for this run

name: Create GitHub Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
release:
name: Create Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Extract release notes from CHANGELOG
id: changelog
run: |
# Extract the section for this version from CHANGELOG.md
version="${GITHUB_REF#refs/tags/v}"
# Extract content between this version header (exclusive) and the
# next version header (exclusive). A single-regex range like
# /A/,/B/ where both patterns can match the same line yields a
# single-line range (the bug that produced empty release notes
# through v0.9.0). Flag-toggle pattern starts AFTER the header.
awk "/^## \[$version\]/{flag=1; next} /^## \[/{flag=0} flag" CHANGELOG.md \
| sed '/^$/d' > release_notes.txt
# Add installation instructions
cat >> release_notes.txt << EOF
## Installation
\`\`\`bash
pip install har-capture==$version
\`\`\`
## Full Changelog
See [CHANGELOG.md](https://github.com/solentlabs/har-capture/blob/v$version/CHANGELOG.md) for complete details.
EOF
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
body_path: release_notes.txt
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}