mirror of
https://github.com/elseif/MikroTikPatch
synced 2026-07-17 10:39:40 +00:00
modified: .github/workflows/mikrotik_patch_7.yml
This commit is contained in:
parent
511392906b
commit
78f63469c9
31
.github/workflows/mikrotik_patch_7.yml
vendored
31
.github/workflows/mikrotik_patch_7.yml
vendored
@ -60,12 +60,12 @@ env:
|
|||||||
CUSTOM_CLOUD_URL: ${{ secrets.CUSTOM_CLOUD_URL }}
|
CUSTOM_CLOUD_URL: ${{ secrets.CUSTOM_CLOUD_URL }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
Set_Variables:
|
Set_Variables:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
outputs:
|
outputs:
|
||||||
BUILD_TIME: ${{ steps.set_vars.outputs.BUILD_TIME }}
|
BUILD_TIME: ${{ steps.set_vars.outputs.BUILD_TIME }}
|
||||||
RELEASE: ${{ steps.set_vars.outputs.RELEASE }}
|
RELEASE: ${{ steps.set_vars.outputs.RELEASE }}
|
||||||
|
MATRIX_JSON: ${{ steps.set_vars.outputs.MATRIX_JSON }}
|
||||||
steps:
|
steps:
|
||||||
- name: Set variables
|
- name: Set variables
|
||||||
id: set_vars
|
id: set_vars
|
||||||
@ -79,30 +79,33 @@ jobs:
|
|||||||
if [ -z "$RELEASE" ]; then
|
if [ -z "$RELEASE" ]; then
|
||||||
RELEASE=false
|
RELEASE=false
|
||||||
fi
|
fi
|
||||||
|
ARCH="${{ github.event.inputs.arch }}"
|
||||||
|
CHANNEL="${{ github.event.inputs.channel }}"
|
||||||
|
MATRIX_JSON=$(jq -nc --arg arch "$ARCH" --arg channel "$CHANNEL" '[{arch: $arch, channel: $channel}]')
|
||||||
else
|
else
|
||||||
BUILD_TIME=$(date +'%Y%m%d%H%M%S')
|
BUILD_TIME=$(date +'%Y%m%d%H%M%S')
|
||||||
RELEASE=true
|
RELEASE=true
|
||||||
|
MATRIX_JSON='[
|
||||||
|
{"arch":"x86","channel":"stable"},
|
||||||
|
{"arch":"arm64","channel":"stable"},
|
||||||
|
{"arch":"x86","channel":"testing"},
|
||||||
|
{"arch":"arm64","channel":"testing"}
|
||||||
|
]'
|
||||||
fi
|
fi
|
||||||
echo "BUILD_TIME=$BUILD_TIME" >> $GITHUB_OUTPUT
|
echo "BUILD_TIME=$BUILD_TIME" >> $GITHUB_OUTPUT
|
||||||
echo "RELEASE=$RELEASE" >> $GITHUB_OUTPUT
|
echo "RELEASE=$RELEASE" >> $GITHUB_OUTPUT
|
||||||
echo "Build time is $BUILD_TIME"
|
echo "MATRIX_JSON=$MATRIX_JSON" >> $GITHUB_OUTPUT
|
||||||
echo "Release flag is $RELEASE"
|
echo "::group::Setting variables..."
|
||||||
|
echo "::notice title=Build Time::$BUILD_TIME"
|
||||||
|
echo "::notice title=Release Enabled::$RELEASE"
|
||||||
|
echo "::notice title=Matrix JSON::$MATRIX_JSON"
|
||||||
|
echo "::endgroup::"
|
||||||
|
|
||||||
Patch_RouterOS:
|
Patch_RouterOS:
|
||||||
needs: Set_Variables
|
needs: Set_Variables
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix: ${{ fromJSON(needs.Set_Variables.outputs.MATRIX_JSON) }}
|
||||||
include:
|
|
||||||
- arch: x86
|
|
||||||
channel: stable
|
|
||||||
- arch: arm64
|
|
||||||
channel: stable
|
|
||||||
- arch: x86
|
|
||||||
channel: testing
|
|
||||||
- arch: arm64
|
|
||||||
channel: testing
|
|
||||||
if: ${{ github.event_name != 'workflow_dispatch' || (github.event.inputs.arch == matrix.arch && github.event.inputs.channel == matrix.channel) }}
|
|
||||||
env:
|
env:
|
||||||
TZ: 'Asia/Shanghai'
|
TZ: 'Asia/Shanghai'
|
||||||
BUILD_TIME: ${{ needs.Set_Variables.outputs.BUILD_TIME }}
|
BUILD_TIME: ${{ needs.Set_Variables.outputs.BUILD_TIME }}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user