diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 48d7ed1..2c8c33f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,35 +6,35 @@ on: workflow_dispatch: jobs: - Build_Stable: + Patch_Stable: uses: ./.github/workflows/build_v7.yml with: channel: stable release: true secrets: inherit - Build_LongTerm: + Patch_LongTerm: uses: ./.github/workflows/build_v7.yml with: channel: long-term release: true secrets: inherit - Build_Testing: + Patch_Testing: uses: ./.github/workflows/build_v7.yml with: channel: testing release: true secrets: inherit - Build_Stable_V6: + Patch_Stable_V6: uses: ./.github/workflows/build_v6.yml with: channel: stable release: true secrets: inherit - Build_LongTerm_V6: + Patch_LongTerm_V6: uses: ./.github/workflows/build_v6.yml with: channel: long-term diff --git a/.github/workflows/build_v6.yml b/.github/workflows/patch_v6.yml similarity index 95% rename from .github/workflows/build_v6.yml rename to .github/workflows/patch_v6.yml index e2d32f3..3af573f 100644 --- a/.github/workflows/build_v6.yml +++ b/.github/workflows/patch_v6.yml @@ -1,4 +1,4 @@ -name: Build RouterOS v6 +name: Patch RouterOS v6 on: workflow_dispatch: inputs: @@ -63,7 +63,7 @@ env: jobs: - Prepare_Build: + Prepare_Patch: runs-on: ubuntu-24.04 outputs: VERSION: ${{ steps.prepare.outputs.VERSION }} @@ -72,7 +72,7 @@ jobs: RELEASE: ${{ steps.prepare.outputs.RELEASE }} SKIP_BUILD: ${{ steps.prepare.outputs.SKIP_BUILD }} steps: - - name: Prepare Build for ${{ inputs.channel }} + - name: Prepare Patch for ${{ inputs.channel }} id: prepare run: | CHANNEL="${{ inputs.channel }}" @@ -109,21 +109,21 @@ jobs: Build_RouterOS: - needs: Prepare_Build - if: needs.Prepare_Build.outputs.SKIP_BUILD == 'false' + needs: Prepare_Patch + if: needs.Prepare_Patch.outputs.SKIP_BUILD == 'false' runs-on: ubuntu-24.04 strategy: matrix: - arch: ${{ fromJson(needs.Prepare_Build.outputs.ARCHS) }} + arch: ${{ fromJson(needs.Prepare_Patch.outputs.ARCHS) }} fail-fast: false env: TZ: 'Asia/Shanghai' CHANNEL: ${{ inputs.channel }} ARCH: ${{ matrix.arch }} - VERSION: ${{ needs.Prepare_Build.outputs.VERSION }} - BUILD_TIME: ${{ needs.Prepare_Build.outputs.BUILD_TIME }} - BUILD_DIR: "/tmp/build/${{ needs.Prepare_Build.outputs.VERSION }}" - PUBLISH_DIR: "${{ github.workspace }}/publish/${{ needs.Prepare_Build.outputs.VERSION }}" + VERSION: ${{ needs.Prepare_Patch.outputs.VERSION }} + BUILD_TIME: ${{ needs.Prepare_Patch.outputs.BUILD_TIME }} + BUILD_DIR: "/tmp/build/${{ needs.Prepare_Patch.outputs.VERSION }}" + PUBLISH_DIR: "${{ github.workspace }}/publish/${{ needs.Prepare_Patch.outputs.VERSION }}" ARCH_EXT: "" PACKAGES: "" steps: @@ -211,7 +211,6 @@ jobs: } ] EOF - sudo apt-get install python3-crcmod > /dev/null HASH=$(python3 -E < /dev/null knock -4 ${{ secrets.SSH_SERVER }} ${{ secrets.SSH_KNOCK_PORT }} @@ -513,7 +511,7 @@ jobs: EOF - name: Clear Cloudflare cache - if: needs.Prepare_Build.outputs.RELEASE == 'true' + if: needs.Prepare_Patch.outputs.RELEASE == 'true' run: | curl --request POST --url "https://api.cloudflare.com/client/v4/zones/096723464400de10b6eb85028baa8372/purge_cache" \ --header "Authorization: Bearer 9GDQkzU51QXaqzp1qMjyFKpyeJyOdnNoG9GZQaGP" \ @@ -522,15 +520,15 @@ jobs: Update_Release: - needs: [Prepare_Build,Build_RouterOS] + needs: [Prepare_Patch,Build_RouterOS] if: | - needs.Prepare_Build.outputs.SKIP_BUILD == 'false' && + needs.Prepare_Patch.outputs.SKIP_BUILD == 'false' && needs.Build_RouterOS.result == 'success' && - needs.Prepare_Build.outputs.RELEASE == 'true' + needs.Prepare_Patch.outputs.RELEASE == 'true' runs-on: ubuntu-24.04 env: CHANNEL: ${{ inputs.channel }} - VERSION: ${{ needs.Prepare_Build.outputs.VERSION }} + VERSION: ${{ needs.Prepare_Patch.outputs.VERSION }} steps: - name: Update Release run: | diff --git a/.github/workflows/build_v7.yml b/.github/workflows/patch_v7.yml similarity index 97% rename from .github/workflows/build_v7.yml rename to .github/workflows/patch_v7.yml index 472fc46..f168505 100644 --- a/.github/workflows/build_v7.yml +++ b/.github/workflows/patch_v7.yml @@ -1,4 +1,4 @@ -name: Build RouterOS v7 +name: Patch RouterOS v7 on: workflow_dispatch: inputs: @@ -77,7 +77,7 @@ env: CUSTOM_CLOUD_URL: ${{ secrets.CUSTOM_CLOUD_URL }} jobs: - Prepare_Build: + Prepare_Patch: runs-on: ubuntu-24.04 outputs: VERSION: ${{ steps.prepare.outputs.VERSION }} @@ -86,7 +86,7 @@ jobs: RELEASE: ${{ steps.prepare.outputs.RELEASE }} SKIP_BUILD: ${{ steps.prepare.outputs.SKIP_BUILD }} steps: - - name: Prepare Build for ${{ inputs.channel }} + - name: Prepare Patch for ${{ inputs.channel }} id: prepare run: | CHANNEL="${{ inputs.channel }}" @@ -128,21 +128,21 @@ jobs: echo "Version: $VERSION, Archs: $ARCHS" Build_RouterOS: - needs: Prepare_Build - if: needs.Prepare_Build.outputs.SKIP_BUILD == 'false' + needs: Prepare_Patch + if: needs.Prepare_Patch.outputs.SKIP_BUILD == 'false' runs-on: ubuntu-24.04 strategy: matrix: - arch: ${{ fromJson(needs.Prepare_Build.outputs.ARCHS) }} + arch: ${{ fromJson(needs.Prepare_Patch.outputs.ARCHS) }} fail-fast: false env: TZ: 'Asia/Shanghai' CHANNEL: ${{ inputs.channel }} ARCH: ${{ matrix.arch }} - VERSION: ${{ needs.Prepare_Build.outputs.VERSION }} - BUILD_TIME: ${{ needs.Prepare_Build.outputs.BUILD_TIME }} - BUILD_DIR: "/tmp/build/${{ needs.Prepare_Build.outputs.VERSION }}" - PUBLISH_DIR: "${{ github.workspace }}/publish/${{ needs.Prepare_Build.outputs.VERSION }}" + VERSION: ${{ needs.Prepare_Patch.outputs.VERSION }} + BUILD_TIME: ${{ needs.Prepare_Patch.outputs.BUILD_TIME }} + BUILD_DIR: "/tmp/build/${{ needs.Prepare_Patch.outputs.VERSION }}" + PUBLISH_DIR: "${{ github.workspace }}/publish/${{ needs.Prepare_Patch.outputs.VERSION }}" ARCH_EXT: "" PACKAGES: "" steps: @@ -328,7 +328,7 @@ jobs: rm -rf $BUILD_DIR/all_packages - name: Cache NetInstall ${{ env.VERSION }} - if: matrix.arch == 'x86' && needs.Prepare_Build.outputs.RELEASE == 'true' + if: matrix.arch == 'x86' && needs.Prepare_Patch.outputs.RELEASE == 'true' id: cache-netinstall uses: actions/cache@v5 with: @@ -338,12 +338,12 @@ jobs: - name: Get netinstall ${{ env.VERSION }} if: | steps.cache-netinstall.outputs.cache-hit != 'true' && - matrix.arch == 'x86' && needs.Prepare_Build.outputs.RELEASE == 'true' + matrix.arch == 'x86' && needs.Prepare_Patch.outputs.RELEASE == 'true' run: | wget -nv -O $BUILD_DIR/netinstall-$VERSION.zip https://download.mikrotik.com/routeros/$VERSION/netinstall-$VERSION.zip - name: Patch netinstall ${{ env.VERSION }} - if: matrix.arch == 'x86' && needs.Prepare_Build.outputs.RELEASE == 'true' + if: matrix.arch == 'x86' && needs.Prepare_Patch.outputs.RELEASE == 'true' run: | unzip $BUILD_DIR/netinstall-$VERSION.zip -d $BUILD_DIR/ python3 patch.py netinstall $BUILD_DIR/netinstall.exe @@ -838,7 +838,7 @@ jobs: rm -rf $BUILD_DIR/chr - name: Upload Files as Artifact (No Release) - if: needs.Prepare_Build.outputs.RELEASE == 'false' + if: needs.Prepare_Patch.outputs.RELEASE == 'false' uses: actions/upload-artifact@v7 with: name: mikrotik-${{ env.VERSION }}${{ env.ARCH_EXT }} @@ -847,7 +847,7 @@ jobs: ${{ env.PUBLISH_DIR }}/*.iso - name: Generate SHA256 checksum files - if: needs.Prepare_Build.outputs.RELEASE == 'true' + if: needs.Prepare_Patch.outputs.RELEASE == 'true' run: | ( cd $PUBLISH_DIR @@ -860,7 +860,7 @@ jobs: ) - name: Delete Release tag ${{ env.VERSION }}${{ env.ARCH_EXT }} - if: needs.Prepare_Build.outputs.RELEASE == 'true' + if: needs.Prepare_Patch.outputs.RELEASE == 'true' run: | sed -i "1i Build Time:$BUILD_TIME" $PUBLISH_DIR/CHANGELOG HEADER="Authorization: token ${{ secrets.GITHUB_TOKEN }}" @@ -879,7 +879,7 @@ jobs: fi - name: Create Release tag ${{ env.VERSION }}${{ env.ARCH_EXT }} - if: needs.Prepare_Build.outputs.RELEASE == 'true' + if: needs.Prepare_Patch.outputs.RELEASE == 'true' uses: softprops/action-gh-release@v3 with: name: "RouterOS ${{ env.VERSION }}${{ env.ARCH_EXT }}" @@ -896,7 +896,7 @@ jobs: ${{env.PUBLISH_DIR}}/*.iso.sha256 - name: Upload Files - if: needs.Prepare_Build.outputs.RELEASE == 'true' + if: needs.Prepare_Patch.outputs.RELEASE == 'true' run: | sudo apt-get install -y knockd lftp > /dev/null knock -4 ${{ secrets.SSH_SERVER }} ${{ secrets.SSH_KNOCK_PORT }} @@ -932,7 +932,7 @@ jobs: EOF - name: Clear Cloudflare cache - if: needs.Prepare_Build.outputs.RELEASE == 'true' + if: needs.Prepare_Patch.outputs.RELEASE == 'true' run: | curl --request POST --url "https://api.cloudflare.com/client/v4/zones/096723464400de10b6eb85028baa8372/purge_cache" \ --header "Authorization: Bearer 9GDQkzU51QXaqzp1qMjyFKpyeJyOdnNoG9GZQaGP" \ @@ -940,15 +940,15 @@ jobs: --data '{"purge_everything": true}' Update_Release: - needs: [Prepare_Build,Build_RouterOS] + needs: [Prepare_Patch,Build_RouterOS] if: | - needs.Prepare_Build.outputs.SKIP_BUILD == 'false' && + needs.Prepare_Patch.outputs.SKIP_BUILD == 'false' && needs.Build_RouterOS.result == 'success' && - needs.Prepare_Build.outputs.RELEASE == 'true' + needs.Prepare_Patch.outputs.RELEASE == 'true' runs-on: ubuntu-24.04 env: CHANNEL: ${{ inputs.channel }} - VERSION: ${{ needs.Prepare_Build.outputs.VERSION }} + VERSION: ${{ needs.Prepare_Patch.outputs.VERSION }} steps: - name: Update Release run: |