modified: .github/workflows/patch_v7.yml

modified:   setup-routeros.sh
This commit is contained in:
elseif
2026-09-02 11:24:23 +08:00
parent 3572a73c28
commit 433252aa17
2 changed files with 29 additions and 23 deletions

View File

@@ -930,18 +930,7 @@ jobs:
run: |
RELEASE_BODY="$BUILD_DIR/RELEASE_BODY.md"
BASE_URL="https://github.com/${{ github.repository }}/releases/download/$VERSION$ARCH_EXT"
cat > "$RELEASE_BODY" << EOF
# RouterOS ${{ env.VERSION }}${{ env.ARCH_EXT }} Release
**Build Time**: $BUILD_TIME
**Architecture**: $ARCH
**Channel**: $CHANNEL
<details><summary><strong>RouterOS</strong></summary>
| Type | File |
|------|------|
EOF
BUILD_TIME_UTC=$(date -u -d "@$BUILD_TIME" "+%Y-%m-%d %H:%M:%S UTC" 2>/dev/null || echo "Invalid timestamp")
link_file() {
local file="$1"
@@ -953,6 +942,17 @@ jobs:
fi
}
cat > "$RELEASE_BODY" << EOF
**Build Time**: $BUILD_TIME_UTC ($BUILD_TIME)
**Architecture**: $ARCH
**Channel**: $CHANNEL
<details><summary><strong>RouterOS</strong></summary>
| Type | File |
|------|------|
EOF
echo "| Main package | $(link_file "$PUBLISH_DIR/routeros-${VERSION}${ARCH_EXT}.npk") |" >> "$RELEASE_BODY"
echo "| Extra packages | $(link_file "$PUBLISH_DIR/all_packages-$ARCH-$VERSION.zip") |" >> "$RELEASE_BODY"
echo "| ISO Image | $(link_file "$PUBLISH_DIR/mikrotik-${VERSION}${ARCH_EXT}.iso") |" >> "$RELEASE_BODY"
@@ -965,23 +965,33 @@ jobs:
echo "<details><summary><strong>Cloud Hosted Router (CHR)</strong></summary>" >> "$RELEASE_BODY"
echo "" >> "$RELEASE_BODY"
if [ "$ARCH" == "x86" ]; then
echo "| Format | UEFI | Legacy BIOS |" >> "$RELEASE_BODY"
echo "| Platform | UEFI | Legacy BIOS |" >> "$RELEASE_BODY"
echo "|--------|------|-------------|" >> "$RELEASE_BODY"
else
echo "| Format | UEFI |" >> "$RELEASE_BODY"
echo "| Platform | UEFI |" >> "$RELEASE_BODY"
echo "|--------|------|" >> "$RELEASE_BODY"
fi
formats=("img" "ova" "qcow2" "vdi" "vhd" "vhdx" "vmdk")
declare -A FORMAT_PLATFORM=(
["img"]="Raw disk image"
["ova"]="Open Virtual Appliance"
["qcow2"]="QEMU/KVM"
["vdi"]="VirtualBox"
["vhd"]="Hyper-V (legacy)"
["vhdx"]="Hyper-V"
["vmdk"]="VMware"
)
for fmt in "${formats[@]}"; do
platform="${FORMAT_PLATFORM[$fmt]}"
uefi_link=$(link_file "$PUBLISH_DIR/chr-$VERSION$ARCH_EXT.$fmt.zip")
if [ "$ARCH" == "x86" ]; then
legacy_link=$(link_file "$PUBLISH_DIR/chr-$VERSION$ARCH_EXT-legacy-bios.$fmt.zip")
echo "| $fmt | $uefi_link | $legacy_link |" >> "$RELEASE_BODY"
echo "| $platform | $uefi_link | $legacy_link |" >> "$RELEASE_BODY"
else
echo "| $fmt | $uefi_link |" >> "$RELEASE_BODY"
echo "| $platform | $uefi_link |" >> "$RELEASE_BODY"
fi
done
echo "</details>" >> "$RELEASE_BODY"
@@ -994,7 +1004,8 @@ jobs:
cat "$PUBLISH_DIR/CHANGELOG" >> "$RELEASE_BODY"
echo "</pre>" >> "$RELEASE_BODY"
echo "</details>" >> "$RELEASE_BODY"
echo " Release body generated at $RELEASE_BODY"
echo "📄 Release body content:"
cat "$RELEASE_BODY"
- name: Create Release tag ${{ env.VERSION }}${{ env.ARCH_EXT }}
if: needs.Prepare_Patch.outputs.RELEASE == 'true'

View File

@@ -1,9 +1,4 @@
#!/bin/bash
# Requires bash >= 4: mapfile, associative arrays (declare -A).
if (( BASH_VERSINFO[0] < 4 )); then
echo "ERROR: this installer requires bash >= 4 (found $BASH_VERSION)." >&2
exit 1
fi
BACKTITLE="MikroTik RouterOS LiveCD Installer"
TITLE="RouterOS Installation Wizard"