From 8661af9d1c9dce92f3992f13ddf809bea2e46978 Mon Sep 17 00:00:00 2001 From: xopenwrt <98641952+xopenwrt@users.noreply.github.com> Date: Mon, 18 Dec 2023 00:49:45 +0800 Subject: [PATCH] Add System Info --- .github/workflows/X-x86_64_X.yml | 14 +++++++++++++ .github/workflows/X-x86_64_X_Mine.yml | 13 +++++++++++- .github/workflows/X-x86_64_Y.yml | 14 ++++++++++++- .github/workflows/X-x86_64_Z.yml | 14 ++++++++++++- .github/workflows/X-x86_64_Z_Mine.yml | 12 ++++++++++- Scripts/AutoBuild_Genenv.sh | 29 +++++++++++++++++++++++++++ 6 files changed, 92 insertions(+), 4 deletions(-) create mode 100644 Scripts/AutoBuild_Genenv.sh diff --git a/.github/workflows/X-x86_64_X.yml b/.github/workflows/X-x86_64_X.yml index ec165e7..cf064ac 100644 --- a/.github/workflows/X-x86_64_X.yml +++ b/.github/workflows/X-x86_64_X.yml @@ -68,6 +68,8 @@ jobs: echo "::set-output name=date::$(date +'%Y-%m-%d')" echo "Release=${{ github.event.inputs.Release }}" >> $GITHUB_ENV echo "SharePoint=${{ github.event.inputs.SharePoint }}" >> $GITHUB_ENV + echo "data2=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT + echo "NOW_DATA_VERSION=v$(date +'%Y-%m-%d')" >> $GITHUB_ENV if [ "${{ env.DELETE_USELESS_FILES }}" == true ] then docker rmi node:18 node:18-alpine node:16-alpine alpine:3.16 alpine:3.17 alpine:3.18 moby/buildkit:latest node:16 ubuntu:20.04 buildpack-deps:stretch buildpack-deps:buster buildpack-deps:bullseye debian:9 debian:10 debian:11 @@ -85,6 +87,18 @@ jobs: remove-android: 'true' remove-haskell: 'true' + - name: Set env & Echo System Info + id: date2 + run: | + export NOW_DATA_VERSION=${{env.NOW_DATA_VERSION}} + export GITHUB_WORKSPACE=$GITHUB_WORKSPACE + + chmod +x $GITHUB_WORKSPACE/Scripts/AutoBuild_*.sh + source $GITHUB_WORKSPACE/Scripts/AutoBuild_Getenv.sh + Get_Action_Info + Get_Release_Info + + - name: Checkout uses: actions/checkout@main with: diff --git a/.github/workflows/X-x86_64_X_Mine.yml b/.github/workflows/X-x86_64_X_Mine.yml index 53b5958..77571ff 100644 --- a/.github/workflows/X-x86_64_X_Mine.yml +++ b/.github/workflows/X-x86_64_X_Mine.yml @@ -62,12 +62,21 @@ jobs: Compile: runs-on: self-hosted steps: - - name: Get current date & Set env + - name: Set env & Echo System Info id: date run: | echo "::set-output name=date::$(date +'%Y-%m-%d')" echo "Release=${{ github.event.inputs.Release }}" >> $GITHUB_ENV echo "SharePoint=${{ github.event.inputs.SharePoint }}" >> $GITHUB_ENV + echo "data2=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT + echo "NOW_DATA_VERSION=v$(date +'%Y-%m-%d')" >> $GITHUB_ENV + + export NOW_DATA_VERSION=${{env.NOW_DATA_VERSION}} + export GITHUB_WORKSPACE=$GITHUB_WORKSPACE + + chmod +x $GITHUB_WORKSPACE/Scripts/AutoBuild_*.sh + source $GITHUB_WORKSPACE/Scripts/AutoBuild_Getenv.sh + if [ "${{ env.DELETE_USELESS_FILES }}" == true ] then docker rmi node:18 node:18-alpine node:16-alpine alpine:3.16 alpine:3.17 alpine:3.18 moby/buildkit:latest node:16 ubuntu:20.04 buildpack-deps:stretch buildpack-deps:buster buildpack-deps:bullseye debian:9 debian:10 debian:11 @@ -75,6 +84,8 @@ jobs: sudo -E apt-get -y autoremove --purge sudo -E apt-get clean fi + Get_Action_Info + Get_Release_Info # - name: Maximize Build Space # uses: easimon/maximize-build-space@master diff --git a/.github/workflows/X-x86_64_Y.yml b/.github/workflows/X-x86_64_Y.yml index 188be96..4673b00 100644 --- a/.github/workflows/X-x86_64_Y.yml +++ b/.github/workflows/X-x86_64_Y.yml @@ -71,12 +71,24 @@ jobs: remove-android: 'true' remove-haskell: 'true' - - name: Get current date & Set env + - name: Set env & Echo System Info id: date run: | echo "::set-output name=date::$(date +'%Y-%m-%d')" echo "Release=${{ github.event.inputs.Release }}" >> $GITHUB_ENV echo "SharePoint=${{ github.event.inputs.SharePoint }}" >> $GITHUB_ENV + echo "data2=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT + echo "NOW_DATA_VERSION=v$(date +'%Y-%m-%d')" >> $GITHUB_ENV + + export NOW_DATA_VERSION=${{env.NOW_DATA_VERSION}} + export GITHUB_WORKSPACE=$GITHUB_WORKSPACE + + chmod +x $GITHUB_WORKSPACE/Scripts/AutoBuild_*.sh + source $GITHUB_WORKSPACE/Scripts/AutoBuild_Getenv.sh + Get_Action_Info + Get_Release_Info + + - name: Checkout uses: actions/checkout@main with: diff --git a/.github/workflows/X-x86_64_Z.yml b/.github/workflows/X-x86_64_Z.yml index 6261564..a295f9c 100644 --- a/.github/workflows/X-x86_64_Z.yml +++ b/.github/workflows/X-x86_64_Z.yml @@ -70,12 +70,24 @@ jobs: remove-dotnet: 'true' remove-android: 'true' - - name: Get current date & Set env + - name: Set env & Echo System Info id: date run: | echo "::set-output name=date::$(date +'%Y-%m-%d')" echo "Release=${{ github.event.inputs.Release }}" >> $GITHUB_ENV echo "SharePoint=${{ github.event.inputs.SharePoint }}" >> $GITHUB_ENV + echo "data2=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT + echo "NOW_DATA_VERSION=v$(date +'%Y-%m-%d')" >> $GITHUB_ENV + + export NOW_DATA_VERSION=${{env.NOW_DATA_VERSION}} + export GITHUB_WORKSPACE=$GITHUB_WORKSPACE + + chmod +x $GITHUB_WORKSPACE/Scripts/AutoBuild_*.sh + source $GITHUB_WORKSPACE/Scripts/AutoBuild_Getenv.sh + Get_Action_Info + Get_Release_Info + + - name: Checkout uses: actions/checkout@main with: diff --git a/.github/workflows/X-x86_64_Z_Mine.yml b/.github/workflows/X-x86_64_Z_Mine.yml index 9724913..db2991f 100644 --- a/.github/workflows/X-x86_64_Z_Mine.yml +++ b/.github/workflows/X-x86_64_Z_Mine.yml @@ -62,12 +62,20 @@ jobs: Compile: runs-on: self-hosted steps: - - name: Get current date & Set env + - name: Set env & Echo System Info id: date run: | echo "::set-output name=date::$(date +'%Y-%m-%d')" echo "Release=${{ github.event.inputs.Release }}" >> $GITHUB_ENV echo "SharePoint=${{ github.event.inputs.SharePoint }}" >> $GITHUB_ENV + echo "data2=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT + echo "NOW_DATA_VERSION=v$(date +'%Y-%m-%d')" >> $GITHUB_ENV + + export NOW_DATA_VERSION=${{env.NOW_DATA_VERSION}} + export GITHUB_WORKSPACE=$GITHUB_WORKSPACE + + chmod +x $GITHUB_WORKSPACE/Scripts/AutoBuild_*.sh + source $GITHUB_WORKSPACE/Scripts/AutoBuild_Getenv.sh if [ "${{ env.DELETE_USELESS_FILES }}" == true ] then docker rmi node:18 node:18-alpine node:16-alpine alpine:3.16 alpine:3.17 alpine:3.18 moby/buildkit:latest node:16 ubuntu:20.04 buildpack-deps:stretch buildpack-deps:buster buildpack-deps:bullseye debian:9 debian:10 debian:11 @@ -75,6 +83,8 @@ jobs: sudo -E apt-get -y autoremove --purge sudo -E apt-get clean fi + Get_Action_Info + Get_Release_Info # - name: Maximize Build Space # uses: easimon/maximize-build-space@master diff --git a/Scripts/AutoBuild_Genenv.sh b/Scripts/AutoBuild_Genenv.sh new file mode 100644 index 0000000..e27b490 --- /dev/null +++ b/Scripts/AutoBuild_Genenv.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# AutoBuild Module by Xinb/Xinbyte +# AutoBuild Functions +Get_Action_Info() { +echo "---------------------------- Soc Info | 🏅AMD Yes ----------------------------" +lscpu | grep "Model name" +lscpu | grep "CPU(s)" +echo "--------------------------------- Memory Info --------------------------------" +free -m +echo "---------------------------------- Disk Info ---------------------------------" +lsblk +echo "------------------------------- Disk Usage Info ------------------------------" +df -h + + +# Get IP Info +echo "------------------------------- IP Address Info ------------------------------" +IP=`curl ip.115115.xyz -s` +curl ip.115115.xyz -s +curl -s https://searchplugin.csdn.net/api/v1/ip/get?ip=${IP} | jq -r .data.address +} + +Get_Release_Info() { +echo "------------------------------- Build Version Data ----------------------------" +echo ${NOW_DATA_VERSION} +echo "------------------------------ Build Kernel Version ---------------------------" +`cat ${OPENWRT_BUILD_DIR}/target/linux/x86/Makefile | grep KERNEL_PATCHVER:=` + +} \ No newline at end of file