fix: improve release note process (#36)
* fix: improve release note process * docs: improve release notes * fix: correct repo name/dir * fix: CVE resolution for jaraco.context * fix: docker build with uv.lovl * fix: CVE remediations * fix: update docker workflow * fix: remove setuptools from base image
This commit is contained in:
@@ -11,6 +11,7 @@ on:
|
||||
- ".dockerignore"
|
||||
- "src/**/*.py"
|
||||
- "pyproject.toml"
|
||||
- "uv.lock"
|
||||
- ".github/workflows/docker.yaml"
|
||||
pull_request:
|
||||
branches: [main, master]
|
||||
@@ -19,6 +20,7 @@ on:
|
||||
- ".dockerignore"
|
||||
- "src/**/*.py"
|
||||
- "pyproject.toml"
|
||||
- "uv.lock"
|
||||
- ".github/workflows/docker.yaml"
|
||||
workflow_dispatch:
|
||||
workflow_call:
|
||||
@@ -106,8 +108,8 @@ jobs:
|
||||
|
||||
- name: Test Docker image
|
||||
run: |
|
||||
# Build for current platform only for testing
|
||||
docker build --build-arg VERSION=${{ steps.version.outputs.VERSION }} -t ${{ env.IMAGE_NAME }}:test .
|
||||
# Build for current platform only for testing (--no-cache ensures fresh build)
|
||||
docker build --no-cache --build-arg VERSION=${{ steps.version.outputs.VERSION }} -t ${{ env.IMAGE_NAME }}:test .
|
||||
|
||||
# Test that the container starts and responds to MCP initialize
|
||||
echo '{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}' | \
|
||||
@@ -129,6 +131,7 @@ jobs:
|
||||
uses: aquasecurity/trivy-action@0.33.1
|
||||
with:
|
||||
image-ref: ${{ env.IMAGE_NAME }}:test
|
||||
version: "v0.68.2"
|
||||
severity: "HIGH,CRITICAL"
|
||||
exit-code: "1"
|
||||
format: "table"
|
||||
@@ -139,6 +142,7 @@ jobs:
|
||||
uses: aquasecurity/trivy-action@0.33.1
|
||||
with:
|
||||
image-ref: ${{ env.IMAGE_NAME }}:test
|
||||
version: "v0.68.2"
|
||||
severity: "MEDIUM,LOW"
|
||||
exit-code: "0"
|
||||
format: "table"
|
||||
@@ -151,6 +155,7 @@ jobs:
|
||||
uses: aquasecurity/trivy-action@0.33.1
|
||||
with:
|
||||
image-ref: ${{ env.IMAGE_NAME }}:test
|
||||
version: "v0.68.2"
|
||||
format: "sarif"
|
||||
output: "trivy-results.sarif"
|
||||
cache-dir: .trivy-cache
|
||||
|
||||
@@ -222,7 +222,7 @@ jobs:
|
||||
echo "Created archives:"
|
||||
ls -la "${ARCHIVE_NAME}-${VERSION}."*
|
||||
|
||||
- name: Extract changelog section
|
||||
- name: Extract release notes section
|
||||
id: changelog
|
||||
env:
|
||||
VERSION: ${{ steps.version.outputs.version }}
|
||||
@@ -233,19 +233,18 @@ jobs:
|
||||
README_FILE: ${{ inputs.readme_file }}
|
||||
WIKI_URL: ${{ inputs.wiki_url }}
|
||||
run: |
|
||||
# Match header exactly as it appears in CHANGELOG.md
|
||||
HEADER="### ${MACRO_NAME} Macro v${VERSION}"
|
||||
RELEASE_NOTES="macros/${MACRO_DIR}/RELEASE_NOTES.md"
|
||||
|
||||
# Extract section between this version header and the next component header or separator
|
||||
# Only exit on: "---" separator OR "### " followed by component name (capital letter)
|
||||
# This allows #### Added, #### Changed, etc. to be included
|
||||
CHANGELOG_CONTENT=$(awk -v header="$HEADER" '
|
||||
# Extract section for this version from RELEASE_NOTES.md
|
||||
# Format: ## Version X.Y.Z (date)
|
||||
CHANGELOG_CONTENT=$(awk -v version="$VERSION" '
|
||||
BEGIN { found=0 }
|
||||
$0 == header || $0 == header " " { found=1; next }
|
||||
found && /^---$/ { exit }
|
||||
found && /^### [A-Z]/ { exit }
|
||||
/^## Version / {
|
||||
if (found) exit
|
||||
if (index($0, version) > 0) { found=1; next }
|
||||
}
|
||||
found { print }
|
||||
' CHANGELOG.md)
|
||||
' "$RELEASE_NOTES" 2>/dev/null || echo "")
|
||||
|
||||
# Build release body
|
||||
cat > release_body.md << EOF
|
||||
|
||||
@@ -347,23 +347,23 @@ jobs:
|
||||
name: python-package-distributions
|
||||
path: dist/
|
||||
|
||||
- name: Extract changelog section
|
||||
- name: Extract release notes section
|
||||
id: changelog
|
||||
run: |
|
||||
VERSION="${{ needs.validate-tag.outputs.version }}"
|
||||
# Match header exactly as it appears in CHANGELOG.md
|
||||
HEADER="### Robust MCP Server v${VERSION}"
|
||||
RELEASE_NOTES="src/freecad_mcp/RELEASE_NOTES.md"
|
||||
|
||||
# Extract section between this version header and the next component header or separator
|
||||
# Only exit on: "---" separator OR "### " followed by component name (capital letter)
|
||||
# This allows #### Added, #### Changed, etc. to be included
|
||||
CHANGELOG_CONTENT=$(awk -v header="$HEADER" '
|
||||
# Extract section for this version from RELEASE_NOTES.md
|
||||
# Format: ## Version X.Y.Z (date)
|
||||
# Extract everything between this version header and the next ## Version header
|
||||
CHANGELOG_CONTENT=$(awk -v version="$VERSION" '
|
||||
BEGIN { found=0 }
|
||||
$0 == header || $0 == header " " { found=1; next }
|
||||
found && /^---$/ { exit }
|
||||
found && /^### [A-Z]/ { exit }
|
||||
/^## Version / {
|
||||
if (found) exit
|
||||
if (index($0, version) > 0) { found=1; next }
|
||||
}
|
||||
found { print }
|
||||
' CHANGELOG.md)
|
||||
' "$RELEASE_NOTES")
|
||||
|
||||
# Write to file for the release body (handles multiline)
|
||||
echo "$CHANGELOG_CONTENT" > changelog_section.md
|
||||
@@ -371,10 +371,10 @@ jobs:
|
||||
# Check if we got content
|
||||
if [ -n "$CHANGELOG_CONTENT" ]; then
|
||||
echo "found=true" >> "$GITHUB_OUTPUT"
|
||||
echo "Extracted changelog section for $HEADER"
|
||||
echo "Extracted release notes for version $VERSION"
|
||||
else
|
||||
echo "found=false" >> "$GITHUB_OUTPUT"
|
||||
echo "No changelog section found for $HEADER"
|
||||
echo "No release notes found for version $VERSION (will use auto-generated notes)"
|
||||
fi
|
||||
|
||||
- name: Create GitHub Release
|
||||
|
||||
@@ -162,23 +162,25 @@ jobs:
|
||||
echo "Created archives:"
|
||||
ls -la "freecad-mcp-workbench-${VERSION}."*
|
||||
|
||||
- name: Extract changelog section
|
||||
- name: Extract release notes section
|
||||
id: changelog
|
||||
run: |
|
||||
VERSION="${{ steps.version.outputs.version }}"
|
||||
# Match header exactly as it appears in CHANGELOG.md (with optional space before v)
|
||||
HEADER="### Robust MCP Bridge Workbench v${VERSION}"
|
||||
RELEASE_NOTES="addon/FreecadRobustMCPBridge/RELEASE_NOTES.md"
|
||||
|
||||
# Extract section between this version header and the next component header or separator
|
||||
# Only exit on: "---" separator OR "### " followed by component name (capital letter)
|
||||
# This allows #### Added, #### Changed, etc. to be included
|
||||
CHANGELOG_CONTENT=$(awk -v header="$HEADER" '
|
||||
# Extract section for this version from RELEASE_NOTES.md
|
||||
# Format: ## Version X.Y.Z (date)
|
||||
# Use exact version match to avoid substring issues (e.g., 1.0.0 matching 1.0.0-alpha)
|
||||
CHANGELOG_CONTENT=$(awk -v version="$VERSION" '
|
||||
BEGIN { found=0 }
|
||||
$0 == header || $0 == header " " { found=1; next }
|
||||
found && /^---$/ { exit }
|
||||
found && /^### [A-Z]/ { exit }
|
||||
/^## Version / {
|
||||
if (found) exit
|
||||
# Extract version field (3rd word) and compare exactly
|
||||
split($0, parts, " ")
|
||||
if (parts[3] == version) { found=1; next }
|
||||
}
|
||||
found { print }
|
||||
' CHANGELOG.md)
|
||||
' "$RELEASE_NOTES" 2>/dev/null || echo "")
|
||||
|
||||
# Build release body with changelog content if available
|
||||
cat > release_body.md << 'STATIC_EOF'
|
||||
|
||||
Reference in New Issue
Block a user