Initial commit: SecuBox v1.0.0

This commit is contained in:
CyberMind-FR 2025-12-21 13:45:08 +01:00
parent 008a3a4c13
commit da4c3c118f
4 changed files with 40 additions and 26 deletions

View File

@ -58,7 +58,8 @@ jobs:
run: | run: |
# Full architecture matrix for OpenWrt # Full architecture matrix for OpenWrt
# Format: target/subtarget -> SDK name mapping # Format: target/subtarget -> SDK name mapping
ALL_TARGETS=$(cat << 'EOF'
cat > /tmp/matrix.json << 'MATRIX_EOF'
{ {
"include": [ "include": [
{ {
@ -159,20 +160,23 @@ jobs:
} }
] ]
} }
EOF MATRIX_EOF
)
INPUT_ARCHS="${{ github.event.inputs.architectures }}" INPUT_ARCHS="${{ github.event.inputs.architectures }}"
if [[ -z "$INPUT_ARCHS" || "$INPUT_ARCHS" == "all" ]]; then if [[ -z "$INPUT_ARCHS" || "$INPUT_ARCHS" == "all" ]]; then
MATRIX="$ALL_TARGETS" MATRIX=$(cat /tmp/matrix.json | jq -c '.')
else else
# Filter matrix based on input # Filter matrix based on input
MATRIX=$(echo "$ALL_TARGETS" | jq -c --arg archs "$INPUT_ARCHS" ' MATRIX=$(cat /tmp/matrix.json | jq -c --arg archs "$INPUT_ARCHS" '
.include |= map(select(.target as $t | $archs | split(",") | map(gsub("^\\s+|\\s+$";"")) | any(. == $t or . == "all"))) .include |= map(select(.target as $t | $archs | split(",") | map(gsub("^\\s+|\\s+$";"")) | any(. == $t or . == "all")))
') ')
fi fi
echo "matrix=$MATRIX" >> $GITHUB_OUTPUT # Use delimiter for multiline output
echo "matrix<<EOF" >> $GITHUB_OUTPUT
echo "$MATRIX" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
echo "📋 Build matrix:" echo "📋 Build matrix:"
echo "$MATRIX" | jq '.' echo "$MATRIX" | jq '.'

View File

@ -46,8 +46,8 @@ jobs:
run: | run: |
DEVICE="${{ github.event.inputs.device }}" DEVICE="${{ github.event.inputs.device }}"
# Define all devices # Define all devices in a file to avoid heredoc issues
ALL_DEVICES=$(cat << 'EOF' cat > /tmp/devices.json << 'DEVICES_EOF'
[ [
{ {
"device": "espressobin-v7", "device": "espressobin-v7",
@ -85,17 +85,20 @@ jobs:
"description": "MOCHAbin (Quad-core A72, 10G)" "description": "MOCHAbin (Quad-core A72, 10G)"
} }
] ]
EOF DEVICES_EOF
)
# Filter based on input # Filter based on input
if [[ "$DEVICE" == "all" ]]; then if [[ "$DEVICE" == "all" ]]; then
MATRIX="{\"include\": $ALL_DEVICES}" MATRIX=$(jq -c '{"include": .}' /tmp/devices.json)
else else
MATRIX=$(echo "$ALL_DEVICES" | jq -c "{\"include\": [.[] | select(.device == \"$DEVICE\")]}") MATRIX=$(jq -c --arg dev "$DEVICE" '{"include": [.[] | select(.device == $dev)]}' /tmp/devices.json)
fi fi
echo "matrix=$MATRIX" >> $GITHUB_OUTPUT # Use delimiter for multiline output
echo "matrix<<EOF" >> $GITHUB_OUTPUT
echo "$MATRIX" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
echo "📋 Build matrix:" echo "📋 Build matrix:"
echo "$MATRIX" | jq '.' echo "$MATRIX" | jq '.'

View File

@ -58,7 +58,8 @@ jobs:
run: | run: |
# Full architecture matrix for OpenWrt # Full architecture matrix for OpenWrt
# Format: target/subtarget -> SDK name mapping # Format: target/subtarget -> SDK name mapping
ALL_TARGETS=$(cat << 'EOF'
cat > /tmp/matrix.json << 'MATRIX_EOF'
{ {
"include": [ "include": [
{ {
@ -159,20 +160,23 @@ jobs:
} }
] ]
} }
EOF MATRIX_EOF
)
INPUT_ARCHS="${{ github.event.inputs.architectures }}" INPUT_ARCHS="${{ github.event.inputs.architectures }}"
if [[ -z "$INPUT_ARCHS" || "$INPUT_ARCHS" == "all" ]]; then if [[ -z "$INPUT_ARCHS" || "$INPUT_ARCHS" == "all" ]]; then
MATRIX="$ALL_TARGETS" MATRIX=$(cat /tmp/matrix.json | jq -c '.')
else else
# Filter matrix based on input # Filter matrix based on input
MATRIX=$(echo "$ALL_TARGETS" | jq -c --arg archs "$INPUT_ARCHS" ' MATRIX=$(cat /tmp/matrix.json | jq -c --arg archs "$INPUT_ARCHS" '
.include |= map(select(.target as $t | $archs | split(",") | map(gsub("^\\s+|\\s+$";"")) | any(. == $t or . == "all"))) .include |= map(select(.target as $t | $archs | split(",") | map(gsub("^\\s+|\\s+$";"")) | any(. == $t or . == "all")))
') ')
fi fi
echo "matrix=$MATRIX" >> $GITHUB_OUTPUT # Use delimiter for multiline output
echo "matrix<<EOF" >> $GITHUB_OUTPUT
echo "$MATRIX" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
echo "📋 Build matrix:" echo "📋 Build matrix:"
echo "$MATRIX" | jq '.' echo "$MATRIX" | jq '.'

View File

@ -46,8 +46,8 @@ jobs:
run: | run: |
DEVICE="${{ github.event.inputs.device }}" DEVICE="${{ github.event.inputs.device }}"
# Define all devices # Define all devices in a file to avoid heredoc issues
ALL_DEVICES=$(cat << 'EOF' cat > /tmp/devices.json << 'DEVICES_EOF'
[ [
{ {
"device": "espressobin-v7", "device": "espressobin-v7",
@ -85,17 +85,20 @@ jobs:
"description": "MOCHAbin (Quad-core A72, 10G)" "description": "MOCHAbin (Quad-core A72, 10G)"
} }
] ]
EOF DEVICES_EOF
)
# Filter based on input # Filter based on input
if [[ "$DEVICE" == "all" ]]; then if [[ "$DEVICE" == "all" ]]; then
MATRIX="{\"include\": $ALL_DEVICES}" MATRIX=$(jq -c '{"include": .}' /tmp/devices.json)
else else
MATRIX=$(echo "$ALL_DEVICES" | jq -c "{\"include\": [.[] | select(.device == \"$DEVICE\")]}") MATRIX=$(jq -c --arg dev "$DEVICE" '{"include": [.[] | select(.device == $dev)]}' /tmp/devices.json)
fi fi
echo "matrix=$MATRIX" >> $GITHUB_OUTPUT # Use delimiter for multiline output
echo "matrix<<EOF" >> $GITHUB_OUTPUT
echo "$MATRIX" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
echo "📋 Build matrix:" echo "📋 Build matrix:"
echo "$MATRIX" | jq '.' echo "$MATRIX" | jq '.'