mirror of
https://github.com/elseif/MikroTikPatch.git
synced 2026-09-04 06:25:47 +00:00
Compare commits
20 Commits
7.24.1-arm
...
6.49.21
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8162e48464 | ||
|
|
fec8972b11 | ||
|
|
6307abfa84 | ||
|
|
777f09760b | ||
|
|
da9a657837 | ||
|
|
a925bfaa51 | ||
|
|
41e23585ef | ||
|
|
778e0adc1d | ||
|
|
e9d87975ac | ||
|
|
82febfa6ae | ||
|
|
4a4c226a47 | ||
|
|
24bb59e3b1 | ||
|
|
88f8a40223 | ||
|
|
f20530ed8c | ||
|
|
dd24667ef4 | ||
|
|
66de07e0a9 | ||
|
|
b606604720 | ||
|
|
452cf3133f | ||
|
|
c00a16b842 | ||
|
|
a5928e0373 |
140
.github/workflows/main.yml
vendored
140
.github/workflows/main.yml
vendored
@@ -2,7 +2,7 @@
|
||||
name: Patch Mikrotik RouterOS
|
||||
on:
|
||||
schedule:
|
||||
- cron: "00 09 * * *" # At UTC 09:00 (Beijing 17:00) on every day
|
||||
- cron: "25 * * * *" # Every hour at minute 25 (UTC)
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
@@ -14,43 +14,113 @@ on:
|
||||
- all
|
||||
- v6
|
||||
- v7
|
||||
release:
|
||||
description: 'Release'
|
||||
required: false
|
||||
default: true
|
||||
type: boolean
|
||||
jobs:
|
||||
Patch_Stable_V7:
|
||||
if: |
|
||||
(github.event_name == 'schedule') ||
|
||||
(github.event_name == 'workflow_dispatch' && (github.event.inputs.version == 'all' || github.event.inputs.version == 'v7'))
|
||||
uses: ./.github/workflows/patch_v7.yml
|
||||
|
||||
Check_Versions:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
upgrades_v6: ${{ steps.set-matrix.outputs.upgrades_v6 }}
|
||||
upgrades_v7: ${{ steps.set-matrix.outputs.upgrades_v7 }}
|
||||
patch_v6: ${{ steps.set-matrix.outputs.patch_v6 }}
|
||||
patch_v7: ${{ steps.set-matrix.outputs.patch_v7 }}
|
||||
steps:
|
||||
- name: Fetch and compare versions
|
||||
id: set-matrix
|
||||
run: |
|
||||
OFFICIAL_UPGRADE=$(curl -s https://upgrade.mikrotik.com/routeros/upgrade.json)
|
||||
echo "$OFFICIAL_UPGRADE" | jq -e . >/dev/null 2>&1 || { echo "ERROR: OFFICIAL_UPGRADE is not valid JSON" >&2; exit 1; }
|
||||
|
||||
if [[ "${{ github.event_name }}" != "workflow_dispatch" ]]; then
|
||||
PATCH_UPGRADE=$(curl -s https://upgrade.mikrotik.ltd/routeros/upgrade.json)
|
||||
echo "$PATCH_UPGRADE" | jq -e . >/dev/null 2>&1 || { echo "ERROR: PATCH_UPGRADE is not valid JSON" >&2; exit 1; }
|
||||
|
||||
CANDIDATES=$(echo "$OFFICIAL_UPGRADE" | jq -c --argjson patch "$PATCH_UPGRADE" '
|
||||
($patch.upgradePaths // {}) as $paths |
|
||||
.upgradePaths // {} | to_entries |
|
||||
map(
|
||||
.value.version as $official_version |
|
||||
($paths[.key] // null) as $patch_value |
|
||||
select(
|
||||
$patch_value != null and
|
||||
$official_version != $patch_value.version and
|
||||
(any($paths[]; .version == $official_version) | not) and
|
||||
((.key | test("^NEWEST6")) or (.key | test("^NEWESTa7"))) and
|
||||
(.key | test("\\.(stable|development|long-term)$"))
|
||||
) |
|
||||
{
|
||||
majorVersion: (.value.version | split(".")[0]),
|
||||
channel: (.key | split(".")[1]),
|
||||
version: .value.version
|
||||
}
|
||||
)
|
||||
')
|
||||
else
|
||||
CANDIDATES=$(echo "$OFFICIAL_UPGRADE" | jq -c '
|
||||
.upgradePaths // {} | to_entries |
|
||||
map(
|
||||
select(
|
||||
((.key | test("^NEWEST6")) or (.key | test("^NEWESTa7")))
|
||||
and
|
||||
(.key | test("\\.(stable|development|long-term)$"))
|
||||
)
|
||||
|
|
||||
{
|
||||
majorVersion: (.value.version | split(".")[0]),
|
||||
channel: (.key | split(".")[1]),
|
||||
version: .value.version
|
||||
}
|
||||
)
|
||||
')
|
||||
fi
|
||||
|
||||
VERSION_FILTER="${{ inputs.version || 'all' }}"
|
||||
V6_MATRIX=$(echo "$CANDIDATES" | jq -c 'map(select(.majorVersion == "6" ))')
|
||||
V7_MATRIX=$(echo "$CANDIDATES" | jq -c 'map(select(.majorVersion == "7" ))')
|
||||
if [[ "$VERSION_FILTER" == "v6" ]]; then
|
||||
V7_MATRIX='[]'
|
||||
elif [[ "$VERSION_FILTER" == "v7" ]]; then
|
||||
V6_MATRIX='[]'
|
||||
fi
|
||||
echo "upgrades_v6=$V6_MATRIX" >> "$GITHUB_OUTPUT"
|
||||
echo "upgrades_v7=$V7_MATRIX" >> "$GITHUB_OUTPUT"
|
||||
echo "patch_v6=$(jq 'length > 0' <<< "$V6_MATRIX")" >> "$GITHUB_OUTPUT"
|
||||
echo "patch_v7=$(jq 'length > 0' <<< "$V7_MATRIX")" >> "$GITHUB_OUTPUT"
|
||||
|
||||
echo "=== Upgrades V6 ==="
|
||||
echo "$V6_MATRIX" | jq .
|
||||
|
||||
echo "=== Upgrades V7 ==="
|
||||
echo "$V7_MATRIX" | jq .
|
||||
|
||||
Patch_V6:
|
||||
needs: Check_Versions
|
||||
if: ${{ needs.Check_Versions.outputs.patch_v6 == 'true' }}
|
||||
uses: ./.github/workflows/patch_v6.yml
|
||||
strategy:
|
||||
matrix:
|
||||
target: ${{ fromJson(needs.Check_Versions.outputs.upgrades_v6) }}
|
||||
fail-fast: false
|
||||
with:
|
||||
channel: stable
|
||||
release: true
|
||||
channel: ${{ matrix.target.channel }}
|
||||
version: ${{ matrix.target.version }}
|
||||
release: ${{ github.event_name != 'workflow_dispatch' || inputs.release }}
|
||||
secrets: inherit
|
||||
|
||||
Patch_LongTerm_V7:
|
||||
if: |
|
||||
(github.event_name == 'schedule') ||
|
||||
(github.event_name == 'workflow_dispatch' && (github.event.inputs.version == 'all' || github.event.inputs.version == 'v7'))
|
||||
Patch_V7:
|
||||
needs: Check_Versions
|
||||
if: ${{ needs.Check_Versions.outputs.patch_v7 == 'true' }}
|
||||
uses: ./.github/workflows/patch_v7.yml
|
||||
strategy:
|
||||
matrix:
|
||||
target: ${{ fromJson(needs.Check_Versions.outputs.upgrades_v7) }}
|
||||
fail-fast: false
|
||||
with:
|
||||
channel: long-term
|
||||
release: true
|
||||
secrets: inherit
|
||||
|
||||
Patch_Stable_V6:
|
||||
if: |
|
||||
(github.event_name == 'schedule') ||
|
||||
(github.event_name == 'workflow_dispatch' && (github.event.inputs.version == 'all' || github.event.inputs.version == 'v6'))
|
||||
uses: ./.github/workflows/patch_v6.yml
|
||||
with:
|
||||
channel: stable
|
||||
release: true
|
||||
secrets: inherit
|
||||
|
||||
Patch_LongTerm_V6:
|
||||
if: |
|
||||
(github.event_name == 'schedule') ||
|
||||
(github.event_name == 'workflow_dispatch' && (github.event.inputs.version == 'all' || github.event.inputs.version == 'v6'))
|
||||
uses: ./.github/workflows/patch_v6.yml
|
||||
with:
|
||||
channel: long-term
|
||||
release: true
|
||||
secrets: inherit
|
||||
channel: ${{ matrix.target.channel }}
|
||||
version: ${{ matrix.target.version }}
|
||||
release: ${{ github.event_name != 'workflow_dispatch' || inputs.release }}
|
||||
secrets: inherit
|
||||
74
.github/workflows/patch_v7.yml
vendored
74
.github/workflows/patch_v7.yml
vendored
@@ -3,13 +3,14 @@ on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
channel:
|
||||
description: 'Channel (stable, long-term)'
|
||||
description: 'Channel (stable, long-term, development)'
|
||||
required: true
|
||||
default: 'stable'
|
||||
type: choice
|
||||
options:
|
||||
- stable
|
||||
- long-term
|
||||
- development
|
||||
arch:
|
||||
description: 'Architecture (x86, arm64)'
|
||||
required: true
|
||||
@@ -946,7 +947,7 @@ jobs:
|
||||
**Architecture**: $ARCH
|
||||
**Channel**: $CHANNEL
|
||||
|
||||
<details><summary><strong>RouterOS</strong></summary>
|
||||
<details open><summary><strong>RouterOS</strong></summary>
|
||||
|
||||
| Type | File |
|
||||
|------|------|
|
||||
@@ -954,7 +955,9 @@ jobs:
|
||||
|
||||
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"
|
||||
if [ "$ARCH" == "x86" ] || [ "$ARCH" == "arm64" ]; then
|
||||
echo "| ISO Image | $(link_file "$PUBLISH_DIR/mikrotik-${VERSION}${ARCH_EXT}.iso") |" >> "$RELEASE_BODY"
|
||||
fi
|
||||
if [ "$ARCH" == "x86" ]; then
|
||||
echo "| Install Image | $(link_file "$PUBLISH_DIR/install-image-$VERSION.zip") |" >> "$RELEASE_BODY"
|
||||
echo "| Netinstall | $(link_file "$PUBLISH_DIR/netinstall-$VERSION.zip") |" >> "$RELEASE_BODY"
|
||||
@@ -962,41 +965,41 @@ jobs:
|
||||
echo "</details>" >> "$RELEASE_BODY"
|
||||
echo "" >> "$RELEASE_BODY"
|
||||
|
||||
echo "<details><summary><strong>Cloud Hosted Router (CHR)</strong></summary>" >> "$RELEASE_BODY"
|
||||
echo "" >> "$RELEASE_BODY"
|
||||
if [ "$ARCH" == "x86" ]; then
|
||||
echo "| Platform | UEFI | Legacy BIOS |" >> "$RELEASE_BODY"
|
||||
echo "|--------|------|-------------|" >> "$RELEASE_BODY"
|
||||
else
|
||||
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" ] || [ "$ARCH" == "arm64" ]; then
|
||||
echo "<details open><summary><strong>Cloud Hosted Router (CHR)</strong></summary>" >> "$RELEASE_BODY"
|
||||
echo "" >> "$RELEASE_BODY"
|
||||
if [ "$ARCH" == "x86" ]; then
|
||||
legacy_link=$(link_file "$PUBLISH_DIR/chr-$VERSION$ARCH_EXT-legacy-bios.$fmt.zip")
|
||||
echo "| $platform | $uefi_link | $legacy_link |" >> "$RELEASE_BODY"
|
||||
echo "| Platform | UEFI | Legacy BIOS |" >> "$RELEASE_BODY"
|
||||
echo "|--------|------|-------------|" >> "$RELEASE_BODY"
|
||||
else
|
||||
echo "| $platform | $uefi_link |" >> "$RELEASE_BODY"
|
||||
echo "| Platform | UEFI |" >> "$RELEASE_BODY"
|
||||
echo "|--------|------|" >> "$RELEASE_BODY"
|
||||
fi
|
||||
done
|
||||
echo "</details>" >> "$RELEASE_BODY"
|
||||
echo "" >> "$RELEASE_BODY"
|
||||
|
||||
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 "| $platform | $uefi_link | $legacy_link |" >> "$RELEASE_BODY"
|
||||
else
|
||||
echo "| $platform | $uefi_link |" >> "$RELEASE_BODY"
|
||||
fi
|
||||
done
|
||||
echo "</details>" >> "$RELEASE_BODY"
|
||||
echo "" >> "$RELEASE_BODY"
|
||||
fi
|
||||
echo "<details><summary><strong>Changelog</strong></summary>" >> "$RELEASE_BODY"
|
||||
echo "" >> "$RELEASE_BODY"
|
||||
echo "<pre>" >> "$RELEASE_BODY"
|
||||
@@ -1016,12 +1019,13 @@ jobs:
|
||||
body_path: ${{env.BUILD_DIR}}/RELEASE_BODY.md
|
||||
tag_name: ${{ env.VERSION }}${{ env.ARCH_EXT }}
|
||||
make_latest: ${{ env.CHANNEL == 'stable' && matrix.arch == 'x86'}}
|
||||
prerelease: ${{ env.CHANNEL == 'development' || env.CHANNEL == 'testing'}}
|
||||
files: |
|
||||
${{env.PUBLISH_DIR}}/*.zip
|
||||
${{env.PUBLISH_DIR}}/*.iso
|
||||
${{env.PUBLISH_DIR}}/routeros*.npk
|
||||
${{env.PUBLISH_DIR}}/*.zip.sha256
|
||||
${{env.PUBLISH_DIR}}/*.iso
|
||||
${{env.PUBLISH_DIR}}/*.iso.sha256
|
||||
${{env.PUBLISH_DIR}}/routeros*.npk
|
||||
${{env.PUBLISH_DIR}}/routeros*.npk.sha256
|
||||
|
||||
- name: Upload Files
|
||||
|
||||
Reference in New Issue
Block a user