feat: prerequisites for overnight-burndown automation (file cmd, policy overlay, env-var logging) #82
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # file: .github/workflows/release.yml | |
| # version: 3.3.2 | |
| # guid: f1a2b3c4-d5e6-7f8a-9b0c-1d2e3f4a5b6c | |
| name: Release Coordinator | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main, develop] | |
| # Added workflow_call to allow other workflows (e.g. CI) to invoke this coordinator | |
| workflow_call: | |
| inputs: | |
| release_type: | |
| required: false | |
| type: string | |
| default: auto | |
| build_target: | |
| required: false | |
| type: string | |
| default: all | |
| prerelease: | |
| required: false | |
| type: boolean | |
| default: false | |
| draft: | |
| required: false | |
| type: boolean | |
| default: false | |
| workflow_dispatch: | |
| inputs: | |
| release_type: | |
| description: "Release type (auto, major, minor, patch)" | |
| required: false | |
| default: "auto" | |
| type: choice | |
| options: | |
| - auto | |
| - major | |
| - minor | |
| - patch | |
| build_target: | |
| description: "Build target" | |
| required: false | |
| default: "all" | |
| type: choice | |
| options: | |
| - all | |
| - go | |
| - python | |
| - frontend | |
| - docker | |
| - protobuf | |
| prerelease: | |
| description: "Create as prerelease" | |
| required: false | |
| default: false | |
| type: boolean | |
| draft: | |
| description: "Create as draft" | |
| required: false | |
| default: false | |
| type: boolean | |
| permissions: | |
| contents: write | |
| packages: write | |
| attestations: write | |
| id-token: write | |
| security-events: write | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }} | |
| jobs: | |
| # Detect what languages/technologies are present | |
| detect-languages: | |
| name: Detect Project Languages | |
| runs-on: ubuntu-latest | |
| outputs: | |
| has-go: ${{ steps.detect.outputs.has-go }} | |
| has-python: ${{ steps.detect.outputs.has-python }} | |
| has-frontend: ${{ steps.detect.outputs.has-frontend }} | |
| has-docker: ${{ steps.detect.outputs.has-docker }} | |
| has-rust: ${{ steps.detect.outputs.has-rust }} | |
| protobuf-needed: ${{ steps.detect.outputs.protobuf-needed }} | |
| primary-language: ${{ steps.detect.outputs.primary-language }} | |
| go-matrix: ${{ steps.detect.outputs.go-matrix }} | |
| python-matrix: ${{ steps.detect.outputs.python-matrix }} | |
| frontend-matrix: ${{ steps.detect.outputs.frontend-matrix }} | |
| docker-matrix: ${{ steps.detect.outputs.docker-matrix }} | |
| registry: ${{ steps.env-setup.outputs.registry }} | |
| image-name: ${{ steps.env-setup.outputs.image-name }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| - name: Detect project languages and generate matrices | |
| id: detect | |
| run: | | |
| python3 .github/scripts/detect_languages.py >> $GITHUB_OUTPUT | |
| - name: Setup environment variables | |
| id: env-setup | |
| run: | | |
| echo "registry=ghcr.io" >> $GITHUB_OUTPUT | |
| echo "image-name=${{ github.repository }}" >> $GITHUB_OUTPUT | |
| # Protobuf generation (if needed, runs first as dependency) | |
| generate-protobuf: | |
| name: Generate Protobuf | |
| needs: detect-languages | |
| if: needs.detect-languages.outputs.protobuf-needed == 'true' | |
| uses: ./.github/workflows/release-protobuf.yml | |
| with: | |
| build_target: ${{ github.event.inputs.build_target || 'all' }} | |
| secrets: inherit | |
| # Call Go workflow if Go is detected | |
| build-go: | |
| name: Build Go Project | |
| needs: [detect-languages] | |
| if: needs.detect-languages.outputs.has-go == 'true' | |
| uses: ./.github/workflows/release-go.yml | |
| with: | |
| go-matrix: ${{ needs.detect-languages.outputs.go-matrix }} | |
| protobuf-artifacts: 'false' | |
| secrets: inherit | |
| # Call Python workflow if Python is detected | |
| build-python: | |
| name: Build Python Project | |
| needs: [detect-languages] | |
| if: needs.detect-languages.outputs.has-python == 'true' | |
| uses: ./.github/workflows/release-python.yml | |
| with: | |
| python-matrix: ${{ needs.detect-languages.outputs.python-matrix }} | |
| protobuf-artifacts: 'false' | |
| secrets: inherit | |
| # Call Frontend workflow if Frontend is detected | |
| build-frontend: | |
| name: Build Frontend Project | |
| needs: [detect-languages] | |
| if: needs.detect-languages.outputs.has-frontend == 'true' | |
| uses: ./.github/workflows/release-frontend.yml | |
| with: | |
| frontend-matrix: ${{ needs.detect-languages.outputs.frontend-matrix }} | |
| protobuf-artifacts: 'false' | |
| secrets: inherit | |
| # Call Docker workflow if Docker is detected | |
| build-docker: | |
| name: Build Docker Project | |
| needs: [detect-languages] | |
| if: needs.detect-languages.outputs.has-docker == 'true' | |
| uses: ./.github/workflows/release-docker.yml | |
| with: | |
| docker-matrix: ${{ needs.detect-languages.outputs.docker-matrix }} | |
| protobuf-artifacts: 'false' | |
| registry: ${{ needs.detect-languages.outputs.registry }} | |
| image-name: ${{ needs.detect-languages.outputs.image-name }} | |
| secrets: inherit | |
| # Call Rust workflow if Rust is detected | |
| build-rust: | |
| name: Build Rust Project | |
| needs: [detect-languages] | |
| if: needs.detect-languages.outputs.has-rust == 'true' | |
| uses: ./.github/workflows/release-rust.yml | |
| with: | |
| protobuf-artifacts: 'false' | |
| secrets: inherit | |
| # Final status check | |
| build-status: | |
| name: Build Status Summary | |
| runs-on: ubuntu-latest | |
| needs: [detect-languages, build-go, build-python, build-frontend, build-docker, build-rust] | |
| if: always() | |
| steps: | |
| - name: Generate build summary | |
| run: | | |
| echo "# 🚀 Release Build Results" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "**Project Type:** ${{ needs.detect-languages.outputs.primary-language }}" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "| Component | Status |" >> $GITHUB_STEP_SUMMARY | |
| echo "|-----------|--------|" >> $GITHUB_STEP_SUMMARY | |
| echo "| Go | ${{ needs.build-go.result || 'skipped' }} |" >> $GITHUB_STEP_SUMMARY | |
| echo "| Python | ${{ needs.build-python.result || 'skipped' }} |" >> $GITHUB_STEP_SUMMARY | |
| echo "| Frontend | ${{ needs.build-frontend.result || 'skipped' }} |" >> $GITHUB_STEP_SUMMARY | |
| echo "| Docker | ${{ needs.build-docker.result || 'skipped' }} |" >> $GITHUB_STEP_SUMMARY | |
| echo "| Rust | ${{ needs.build-rust.result || 'skipped' }} |" >> $GITHUB_STEP_SUMMARY | |
| # Check for any failures | |
| if [[ "${{ needs.build-go.result }}" == "failure" || | |
| "${{ needs.build-python.result }}" == "failure" || | |
| "${{ needs.build-frontend.result }}" == "failure" || | |
| "${{ needs.build-docker.result }}" == "failure" || | |
| "${{ needs.build-rust.result }}" == "failure" ]]; then | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "❌ **Some builds failed**" >> $GITHUB_STEP_SUMMARY | |
| exit 1 | |
| else | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "✅ **All builds completed successfully**" >> $GITHUB_STEP_SUMMARY | |
| fi |