-
Notifications
You must be signed in to change notification settings - Fork 16
87 lines (70 loc) · 3.09 KB
/
Copy pathrelease-extensions-dev.yaml
File metadata and controls
87 lines (70 loc) · 3.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# 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=$(grep "^name:" "$manifest" | sed 's/name: *//' | tr -d '\r')
type=$(grep "^type:" "$manifest" | sed 's/type: *//' | tr -d '\r')
version=$(grep '^version:' "$manifest" | sed 's/[^:]*:[[:space:]]*//g' | tr -d '"' || echo "")
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