Nightly Release Dev Extensions #106
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
| # Copyright Built On Envoy | |
| # SPDX-License-Identifier: Apache-2.0 | |
| # The full text of the Apache license is available in the LICENSE file at | |
| # the root of the repo. | |
| name: Nightly Release Dev Extensions | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' | |
| jobs: | |
| detect-dev-changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| changed-extensions: ${{ steps.detect.outputs.extensions }} | |
| has-changes: ${{ steps.detect.outputs.has-changes }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Detect dev version changes | |
| id: detect | |
| run: | | |
| set -e | |
| echo "Checking for extensions with -dev versions changed in the last day..." | |
| changed_extensions="[]" | |
| has_changes="false" | |
| # Get all top-level extension directories with any code change in the last day | |
| changed_dirs=$(git log --since="1 day ago" --name-only --format="" | grep -E '^extensions/[^/]+/' | sed 's|^\(extensions/[^/]*\)/.*|\1|' | sort -u || true) | |
| if [ -z "$changed_dirs" ]; then | |
| echo "No extensions changed in the last day" | |
| echo "extensions=$changed_extensions" >> "$GITHUB_OUTPUT" | |
| echo "has-changes=$has_changes" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| echo "Changed extension directories: $changed_dirs" | |
| for ext_dir in $changed_dirs; do | |
| manifest="$ext_dir/manifest.yaml" | |
| echo "Checking $manifest..." | |
| if [ ! -f "$manifest" ]; then | |
| echo "No manifest.yaml found in $ext_dir, skipping" | |
| continue | |
| fi | |
| ext_path=$(echo "$ext_dir" | cut -d'/' -f2) | |
| ext_name=$(yq '.name' "$manifest") | |
| type=$(yq '.type' "$manifest") | |
| version=$(yq '.version' "$manifest") | |
| echo "Extension: $ext_name (type=$type, path=$ext_path)" | |
| echo "Version: $version" | |
| # Check if version matches x.y.z-dev | |
| if echo "$version" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+-dev$'; then | |
| echo "Dev version detected for $ext_name: $version" | |
| changed_extensions=$(echo "$changed_extensions" | jq -c \ | |
| --arg name "$ext_name" \ | |
| --arg type "$type" \ | |
| --arg path "$ext_path" \ | |
| '. + [{name: $name, type: $type, path: $path}]') | |
| has_changes="true" | |
| else | |
| echo "Skipping $ext_name: version '$version' does not match x.y.z-dev format" | |
| fi | |
| done | |
| echo "Changed extensions: $changed_extensions" | |
| echo "extensions=$changed_extensions" >> "$GITHUB_OUTPUT" | |
| echo "has-changes=$has_changes" >> "$GITHUB_OUTPUT" | |
| release-dev-extensions: | |
| needs: detect-dev-changes | |
| if: needs.detect-dev-changes.outputs.has-changes == 'true' | |
| uses: ./.github/workflows/release-extensions-impl.yaml | |
| with: | |
| extensions: ${{ needs.detect-dev-changes.outputs.changed-extensions }} | |
| secrets: inherit |