docs-v2/.github/workflows/influxdb3-release.yml
Workflow config file is invalid. Please check your config file: yaml: line 218: could not find expected ':'

266 lines
10 KiB
YAML
Raw Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

name: InfluxDB 3 Release Documentation
on:
workflow_dispatch:
inputs:
product:
description: 'Product being released'
required: true
type: choice
options:
- core
- enterprise
- both
version:
description: 'Version being released (e.g., 3.0.0)'
required: true
type: string
previous_version:
description: 'Previous version for comparison (e.g., 2.9.0)'
required: true
type: string
dry_run:
description: 'Dry run (do not create PRs or issues)'
required: false
type: boolean
default: true
jobs:
generate-release-notes:
name: Generate Release Notes
runs-on: ubuntu-latest
outputs:
release_notes_generated: ${{ steps.generate.outputs.generated }}
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Generate release notes
id: generate
run: |
echo "Generating release notes for ${{ github.event.inputs.product }} v${{ github.event.inputs.version }}"
# TODO: Call the actual generate-release-notes script when it exists
# node ./helper-scripts/influxdb3-monolith/generate-release-notes.js \
# --product ${{ github.event.inputs.product }} \
# --version ${{ github.event.inputs.version }} \
# --previous ${{ github.event.inputs.previous_version }}
# For now, create a placeholder
mkdir -p helper-scripts/output/release-notes
echo "# Release Notes for ${{ github.event.inputs.product }} v${{ github.event.inputs.version }}" > helper-scripts/output/release-notes/release-notes-${{ github.event.inputs.product }}-${{ github.event.inputs.version }}.md
echo "Generated: true" >> $GITHUB_OUTPUT
- name: Upload release notes
uses: actions/upload-artifact@v4
with:
name: release-notes-${{ github.event.inputs.product }}-${{ github.event.inputs.version }}
path: helper-scripts/output/release-notes/
retention-days: 30
audit-cli-documentation:
name: Audit CLI Documentation
needs: generate-release-notes
runs-on: ubuntu-latest
if: needs.generate-release-notes.outputs.release_notes_generated == 'true'
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Pull Docker images for version
run: |
VERSION="${{ github.event.inputs.version }}"
PRODUCT="${{ github.event.inputs.product }}"
if [ "$PRODUCT" == "both" ]; then
docker pull influxdb:${VERSION}-core || true
docker pull influxdb:${VERSION}-enterprise || true
else
docker pull influxdb:${VERSION}-${PRODUCT} || true
fi
- name: Run CLI audit
run: |
PRODUCT="${{ github.event.inputs.product }}"
VERSION="${{ github.event.inputs.version }}"
node ./helper-scripts/influxdb3-monolith/audit-cli-documentation.js $PRODUCT $VERSION
- name: Upload CLI audit reports
uses: actions/upload-artifact@v4
with:
name: cli-audit-release-${{ github.event.inputs.product }}-${{ github.event.inputs.version }}
path: helper-scripts/output/cli-audit/
retention-days: 90
create-documentation-pr:
name: Create Documentation PR
needs: [generate-release-notes, audit-cli-documentation]
runs-on: ubuntu-latest
if: github.event.inputs.dry_run != 'true'
steps:
- uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts/
- name: Create release branch
run: |
BRANCH="release-docs-${{ github.event.inputs.product }}-${{ github.event.inputs.version }}"
git checkout -b $BRANCH
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
- name: Copy release notes to docs
run: |
# TODO: Copy release notes to appropriate documentation location
echo "Release notes would be copied here"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ env.BRANCH }}
title: "docs: Release documentation for ${{ github.event.inputs.product }} v${{ github.event.inputs.version }}"
body: |
## Release Documentation Update
This PR contains documentation updates for **${{ github.event.inputs.product }} v${{ github.event.inputs.version }}**
### Included Updates:
- [ ] Release notes
- [ ] Version updates
- [ ] CLI documentation audit results
### Artifacts:
- [Release Notes](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
- [CLI Audit Report](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
### Manual Review Needed:
Please review the CLI audit report for any missing or outdated documentation that needs to be updated.
---
*This PR was automatically generated by the release workflow.*
labels: |
documentation
release
${{ github.event.inputs.product }}
draft: true
create-audit-issue:
name: Create CLI Audit Issue
needs: audit-cli-documentation
runs-on: ubuntu-latest
if: github.event.inputs.dry_run != 'true'
steps:
- uses: actions/checkout@v4
- name: Download audit report
uses: actions/download-artifact@v4
with:
name: cli-audit-release-${{ github.event.inputs.product }}-${{ github.event.inputs.version }}
path: audit-report/
- name: Create issue from audit
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const product = '${{ github.event.inputs.product }}';
const version = '${{ github.event.inputs.version }}';
// Find and read the audit report
const files = fs.readdirSync('audit-report');
const auditFile = files.find(f => f.includes('documentation-audit'));
if (!auditFile) {
console.log('No audit report found');
return;
}
const report = fs.readFileSync(`audit-report/${auditFile}`, 'utf8');
// Check if there are any issues to report
const hasMissingOptions = report.includes('⚠️ Missing from docs');
const hasExtraOptions = report.includes(' Documented but not in CLI');
if (hasMissingOptions || hasExtraOptions) {
// Create issue
await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: `CLI Documentation Updates Needed - ${product} v${version}`,
body: `## CLI Documentation Audit Results
The following documentation issues were found during the release of **${product} v${version}**:
${report}
### Action Items:
- [ ] Review and update documentation for commands with missing options
- [ ] Remove documentation for deprecated options
- [ ] Verify all examples work with the new version
- [ ] Update any version-specific content
---
*This issue was automatically generated during the release process.*`,
labels: ['documentation', 'cli-audit', 'release', product],
milestone: version // Assumes milestone exists for version
});
console.log('Created issue for CLI documentation updates');
} else {
console.log('No documentation issues found - skipping issue creation');
}
summary:
name: Release Summary
needs: [generate-release-notes, audit-cli-documentation, create-documentation-pr, create-audit-issue]
runs-on: ubuntu-latest
if: always()
steps:
- name: Generate summary
run: |
echo "# Release Documentation Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "## Release Information" >> $GITHUB_STEP_SUMMARY
echo "- **Product**: ${{ github.event.inputs.product }}" >> $GITHUB_STEP_SUMMARY
echo "- **Version**: ${{ github.event.inputs.version }}" >> $GITHUB_STEP_SUMMARY
echo "- **Previous Version**: ${{ github.event.inputs.previous_version }}" >> $GITHUB_STEP_SUMMARY
echo "- **Dry Run**: ${{ github.event.inputs.dry_run }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "## Workflow Results" >> $GITHUB_STEP_SUMMARY
echo "| Step | Status |" >> $GITHUB_STEP_SUMMARY
echo "|------|--------|" >> $GITHUB_STEP_SUMMARY
echo "| Generate Release Notes | ${{ needs.generate-release-notes.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| CLI Documentation Audit | ${{ needs.audit-cli-documentation.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| Create Documentation PR | ${{ needs.create-documentation-pr.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| Create Audit Issue | ${{ needs.create-audit-issue.result }} |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ "${{ github.event.inputs.dry_run }}" == "true" ]; then
echo "**Note**: This was a dry run. No PRs or issues were created." >> $GITHUB_STEP_SUMMARY
fi