docs-v2/.github/workflows/prepare-release.yml

108 lines
3.5 KiB
YAML

name: Prepare Documentation Release
on:
workflow_dispatch:
inputs:
product:
description: 'Product to release'
required: true
type: choice
options:
- core
- enterprise
- cloud-serverless
- cloud-dedicated
version:
description: 'Version number (e.g., 3.2.1)'
required: true
release_type:
description: 'Release type'
required: true
type: choice
options:
- major
- minor
- patch
- hotfix
jobs:
prepare-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create release branch
run: |
git checkout -b docs-release-v${{ inputs.version }}
- 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
run: |
# Note: This workflow assumes release notes are generated manually or from tagged releases
# For Core/Enterprise products, the script needs repository access which would require
# checking out the influxdb and influxdb_pro repositories first
echo "Warning: Release notes generation requires access to InfluxDB source repositories"
echo "For now, creating a placeholder file that should be replaced with actual release notes"
# Create output directory
mkdir -p helper-scripts/output/release-notes
# Create placeholder release notes file
cat > helper-scripts/output/release-notes/release-notes-v${{ inputs.version }}.md << EOF
## v${{ inputs.version }} {date="$(date +'%Y-%m-%d')"}
### Features
- TODO: Add features for ${{ inputs.product }} v${{ inputs.version }}
### Bug Fixes
- TODO: Add bug fixes for ${{ inputs.product }} v${{ inputs.version }}
<!--
Note: This is a placeholder file generated by the workflow.
To generate actual release notes with commit history, run:
For Core/Enterprise:
node ./helper-scripts/common/generate-release-notes.js \\
--config ./helper-scripts/common/config/influxdb3-core-enterprise.json \\
v$(echo "${{ inputs.version }}" | sed 's/^v//') \\
v${{ inputs.version }}
For other products:
node ./helper-scripts/common/generate-release-notes.js \\
--config ./helper-scripts/common/config/[product-config].json \\
v$(echo "${{ inputs.version }}" | sed 's/^v//') \\
v${{ inputs.version }}
-->
EOF
- name: Update product versions
run: |
# Script to update data/products.yml
./helper-scripts/common/update-product-version.sh \
--product ${{ inputs.product }} \
--version ${{ inputs.version }}
- name: Create release checklist issue
uses: actions/github-script@v7
with:
script: |
const checklist = require('./.github/scripts/release-checklist.js');
await checklist.createIssue({
github,
context,
product: '${{ inputs.product }}',
version: '${{ inputs.version }}',
releaseType: '${{ inputs.release_type }}'
})