mirror of
https://github.com/elseif/MikroTikPatch
synced 2026-07-17 18:49:41 +00:00
Update self_hosted_patch.yml
Signed-off-by: elseif <elseif@live.cn>
This commit is contained in:
parent
f54f9f15b6
commit
db75ad1711
16
.github/workflows/self_hosted_patch.yml
vendored
16
.github/workflows/self_hosted_patch.yml
vendored
@ -445,7 +445,7 @@ jobs:
|
|||||||
sudo rm ./install-image-$LATEST_VERSION.img
|
sudo rm ./install-image-$LATEST_VERSION.img
|
||||||
|
|
||||||
- name: Cache NetInstall ${{ env.LATEST_VERSION }}
|
- name: Cache NetInstall ${{ env.LATEST_VERSION }}
|
||||||
if: steps.get_latest.outputs.has_new_version == 'true' && matrix.arch == 'x86' && inputs.release == 'true'
|
if: steps.get_latest.outputs.has_new_version == 'true' && matrix.arch == 'x86' && github.event.inputs.release == 'true'
|
||||||
id: cache-netinstall
|
id: cache-netinstall
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
@ -455,13 +455,13 @@ jobs:
|
|||||||
key: netinstall-${{ env.LATEST_VERSION }}
|
key: netinstall-${{ env.LATEST_VERSION }}
|
||||||
|
|
||||||
- name: Get netinstall ${{ env.LATEST_VERSION }}
|
- name: Get netinstall ${{ env.LATEST_VERSION }}
|
||||||
if: steps.get_latest.outputs.has_new_version == 'true' && matrix.arch == 'x86' && steps.cache-netinstall.outputs.cache-hit != 'true' && inputs.release == 'true'
|
if: steps.get_latest.outputs.has_new_version == 'true' && matrix.arch == 'x86' && steps.cache-netinstall.outputs.cache-hit != 'true' && github.event.inputs.release == 'true'
|
||||||
run: |
|
run: |
|
||||||
sudo wget -nv -O netinstall.zip https://download.mikrotik.com/routeros/$LATEST_VERSION/netinstall-$LATEST_VERSION.zip
|
sudo wget -nv -O netinstall.zip https://download.mikrotik.com/routeros/$LATEST_VERSION/netinstall-$LATEST_VERSION.zip
|
||||||
sudo wget -nv -O netinstall.tar.gz https://download.mikrotik.com/routeros/$LATEST_VERSION/netinstall-$LATEST_VERSION.tar.gz
|
sudo wget -nv -O netinstall.tar.gz https://download.mikrotik.com/routeros/$LATEST_VERSION/netinstall-$LATEST_VERSION.tar.gz
|
||||||
|
|
||||||
- name: Patch netinstall ${{ env.LATEST_VERSION }}
|
- name: Patch netinstall ${{ env.LATEST_VERSION }}
|
||||||
if: steps.get_latest.outputs.has_new_version == 'true' && matrix.arch == 'x86' && inputs.release == 'true'
|
if: steps.get_latest.outputs.has_new_version == 'true' && matrix.arch == 'x86' && github.event.inputs.release == 'true'
|
||||||
run: |
|
run: |
|
||||||
sudo unzip netinstall.zip
|
sudo unzip netinstall.zip
|
||||||
sudo -E python3 patch.py netinstall netinstall.exe
|
sudo -E python3 patch.py netinstall netinstall.exe
|
||||||
@ -471,7 +471,7 @@ jobs:
|
|||||||
sudo tar -czvf netinstall-$LATEST_VERSION.tar.gz ./netinstall-cli
|
sudo tar -czvf netinstall-$LATEST_VERSION.tar.gz ./netinstall-cli
|
||||||
|
|
||||||
- name: Upload Files
|
- name: Upload Files
|
||||||
if: steps.get_latest.outputs.has_new_version == 'true' && inputs.release == 'true'
|
if: steps.get_latest.outputs.has_new_version == 'true' && github.event.inputs.release == 'true'
|
||||||
run: |
|
run: |
|
||||||
sudo mkdir -p ./publish/$LATEST_VERSION
|
sudo mkdir -p ./publish/$LATEST_VERSION
|
||||||
sudo cp CHANGELOG ./publish/$LATEST_VERSION/
|
sudo cp CHANGELOG ./publish/$LATEST_VERSION/
|
||||||
@ -485,7 +485,7 @@ jobs:
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
- name: Clear Cloudflare cache
|
- name: Clear Cloudflare cache
|
||||||
if: steps.get_latest.outputs.has_new_version == 'true' && inputs.release == 'true'
|
if: steps.get_latest.outputs.has_new_version == 'true' && github.event.inputs.release == 'true'
|
||||||
run: |
|
run: |
|
||||||
curl --request POST --url "https://api.cloudflare.com/client/v4/zones/fe6831ed6dc9e6235e69ef2a31f2e7fe/purge_cache" \
|
curl --request POST --url "https://api.cloudflare.com/client/v4/zones/fe6831ed6dc9e6235e69ef2a31f2e7fe/purge_cache" \
|
||||||
--header "Authorization: Bearer 9GDQkzU51QXaqzp1qMjyFKpyeJyOdnNoG9GZQaGP" \
|
--header "Authorization: Bearer 9GDQkzU51QXaqzp1qMjyFKpyeJyOdnNoG9GZQaGP" \
|
||||||
@ -493,7 +493,7 @@ jobs:
|
|||||||
--data '{"purge_everything": true}'
|
--data '{"purge_everything": true}'
|
||||||
|
|
||||||
- name: Delete Release tag ${{ env.LATEST_VERSION }} ${{ matrix.arch }}
|
- name: Delete Release tag ${{ env.LATEST_VERSION }} ${{ matrix.arch }}
|
||||||
if: steps.get_latest.outputs.has_new_version == 'true' && inputs.release == 'true'
|
if: steps.get_latest.outputs.has_new_version == 'true' && github.event.inputs.release == 'true'
|
||||||
run: |
|
run: |
|
||||||
HEADER="Authorization: token ${{ secrets.GITHUB_TOKEN }}"
|
HEADER="Authorization: token ${{ secrets.GITHUB_TOKEN }}"
|
||||||
RELEASE_INFO=$(curl -s -H $HEADER https://api.github.com/repos/${{ github.repository }}/releases/tags/$LATEST_VERSION$ARCH)
|
RELEASE_INFO=$(curl -s -H $HEADER https://api.github.com/repos/${{ github.repository }}/releases/tags/$LATEST_VERSION$ARCH)
|
||||||
@ -509,7 +509,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Create Release tag ${{ env.LATEST_VERSION }} ${{ matrix.arch }}
|
- name: Create Release tag ${{ env.LATEST_VERSION }} ${{ matrix.arch }}
|
||||||
if: steps.get_latest.outputs.has_new_version == 'true' && inputs.release == 'true'
|
if: steps.get_latest.outputs.has_new_version == 'true' && github.event.inputs.release == 'true'
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
name: "RouterOS ${{ env.LATEST_VERSION }} ${{ matrix.arch }}"
|
name: "RouterOS ${{ env.LATEST_VERSION }} ${{ matrix.arch }}"
|
||||||
@ -526,7 +526,7 @@ jobs:
|
|||||||
all_packages-*-${{ env.LATEST_VERSION }}.zip
|
all_packages-*-${{ env.LATEST_VERSION }}.zip
|
||||||
|
|
||||||
- name: Create Packages CSV File
|
- name: Create Packages CSV File
|
||||||
if: inputs.release == 'true'
|
if: github.event.inputs.release == 'true'
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get install ssh sshpass
|
sudo apt-get install ssh sshpass
|
||||||
sshpass -p "${{ secrets.SSH_PASSWORD }}" ssh -o StrictHostKeyChecking=no -p ${{ secrets.SSH_PORT }} ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_SERVER }} "echo $LATEST_VERSION $BUILD_TIME | tee /rw/disk/${{ secrets.SSH_DIRECTORY }}/NEWESTa7.${{ matrix.channel }}; /rw/disk/${{ secrets.SSH_DIRECTORY }}/packages.sh /rw/disk/${{ secrets.SSH_DIRECTORY }}/$LATEST_VERSION"
|
sshpass -p "${{ secrets.SSH_PASSWORD }}" ssh -o StrictHostKeyChecking=no -p ${{ secrets.SSH_PORT }} ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_SERVER }} "echo $LATEST_VERSION $BUILD_TIME | tee /rw/disk/${{ secrets.SSH_DIRECTORY }}/NEWESTa7.${{ matrix.channel }}; /rw/disk/${{ secrets.SSH_DIRECTORY }}/packages.sh /rw/disk/${{ secrets.SSH_DIRECTORY }}/$LATEST_VERSION"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user