Skip to content

Commit e88953f

Browse files
authored
test
1 parent 7556e30 commit e88953f

2 files changed

Lines changed: 70 additions & 17 deletions

File tree

.github/workflows/Build-Kernel.yml

Lines changed: 69 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build Kernel 2.0
1+
name: Build Kernels
22

33
on:
44
# schedule:
@@ -30,39 +30,92 @@ jobs:
3030
run:
3131
shell: bash
3232
steps:
33-
- name: "PRE-BUILD CHECKS"
33+
- name: "✔️ Pre-build checks"
3434
id: prebuild-checks
3535
run: |
36-
echo "cancel=false" >> $GITHUB_OUTPUT
36+
body="$(pwd)/body.txt"
37+
jsonFile="/home/runner/kernels.json"
38+
WSL_DATE="$( wget -qO- https://api.github.com/repos/microsoft/WSL2-Linux-Kernel/commits | jq '.[1].commit.committer.date' -r )"
39+
LAST_DATE="$( wget -qO- https://api.github.com/repos/$GITHUB_REPOSITORY/releases/latest | jq .published_at -r )" || LAST_DATE="2000.01.01T00:00:00Z"
40+
echo "The last WSL2 Kernel commit date is: $WSL_DATE"
41+
echo "The last Release in this repo was on: $LAST_DATE"
42+
if [[ $WSL_DATE > $LAST_DATE ]]; then
43+
echo "NEW KERNEL SOURCE!!!!"
44+
echo "# KERNEL UPDATES" > $body
45+
echo >> $body
46+
wget -qO- https://api.github.com/repos/microsoft/WSL2-Linux-Kernel/releases/latest | jq .body -r >> $body
47+
fi
48+
if [[ "$GITHUB_EVENT_NAME" == "workflow_dispatch" ]]; then
49+
echo "NEW IMPROVEMENT!!!!"
50+
[ -f $body ] && echo >> $body
51+
echo "# IMPROVEMENTS" >> $body
52+
echo >> $body
53+
fi
54+
if [ -f $body ]; then
55+
echo "{}" | jq "\
56+
.commitDate |= \"${WSL_DATE}\" |\
57+
.buildDate |= \"$(TZ=UTC date +'%Y.%m.%dT%H:%M:%SZ')\"" > $jsonFile
58+
echo "cancel=false" >> $GITHUB_OUTPUT
59+
else
60+
echo "NOTHING NEW. CANCELLING ACTION..."
61+
echo "cancel=true" >> $GITHUB_OUTPUT
62+
fi
3763
38-
39-
- name: "⏬ Checkout repository"
64+
- name: "⏬ Download repository"
4065
if: ${{ steps.prebuild-checks.outputs.cancel }} != 'true'
4166
uses: actions/checkout@v3
4267

68+
- name: "⏬ Download and Install Toolchain"
69+
if: ${{ steps.prebuild-checks.outputs.cancel }} != 'true'
70+
run: sudo apt -y install build-essential flex bison dwarves libssl-dev libelf-dev python3 bc jq aria2 p7zip-full
71+
72+
- name: "⏬ Fetch latest WSL kernel source"
73+
if: ${{ steps.prebuild-checks.outputs.cancel }} != 'true'
74+
run: git clone --depth=1 https://github.com/microsoft/WSL2-Linux-Kernel.git kernel
4375

44-
- name: "DETECT CONFIGS"
76+
- name: "🔍 Detect Configurations"
4577
id: set-matrix
4678
if: ${{ steps.prebuild-checks.outputs.cancel }} != 'true'
4779
shell: pwsh
4880
run: |
4981
$m=@{include = @()}
5082
(gci *.dif).baseName | % { $m.include+=@{config = $_} }
51-
"MATRIX:"
52-
$m | ConvertTo-Json
53-
"MATRIX STRING:"
54-
"matrix=$(($m | ConvertTo-Json -compress) -replace '"','`"')"
5583
"matrix=$(($m | ConvertTo-Json -compress) -replace '"','`"')" >> $env:GITHUB_OUTPUT
5684
85+
- name: "📨 Send repo to jobs"
86+
uses: actions/cache@v3.2.6
87+
id: cache-sources
88+
with:
89+
path: ./*
90+
key: ${{ github.sha }}-repo
5791

58-
- name: "✔️ TEST matrix"
59-
if: ${{ steps.prebuild-checks.outputs.cancel }} != 'true'
92+
- name: "📨 Send release body"
93+
uses: actions/cache@v3.2.6
94+
id: cache-sources
95+
with:
96+
path: ./body.txt
97+
key: ${{ github.sha }}-body
98+
99+
- name: "🔧 Prepare debug session"
100+
if: github.event.inputs.debug_enabled == 'true'
60101
run: |
61-
echo "MATRIX:"
62-
echo ${{ steps.set-matrix.outputs.matrix }}
63-
echo "CANCEL:"
64-
echo ${{ steps.prebuild-checks.outputs.cancel }}
102+
sudo apt -y install zsh zsh-syntax-highlighting
103+
sudo wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-amd64 -O /usr/local/bin/oh-my-posh
104+
sudo chmod +x /usr/local/bin/oh-my-posh
105+
wget -q https://github.com/okibcn/miniU/raw/main/Github_Linux/.nanorc -O ~/.nanorc
106+
wget -q https://github.com/okibcn/miniU/raw/main/Github_Linux/profile.sh -O ~/profile.sh
107+
cp /etc/bash.bashrc ~
108+
cat ~/profile.sh >> ~/bash.bashrc
109+
sudo cp ~/bash.bashrc /etc/bash.bashrc -f
110+
cp ~/profile.sh ~/.zshrc
65111
112+
- name: "🐞 Debug session"
113+
uses: mxschmitt/action-tmate@v3
114+
if: github.event.inputs.debug_enabled == 'true'
115+
env:
116+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
117+
## More info at https://til.simonwillison.net/github-actions/debug-tmate
118+
## or https://github.com/mxschmitt/action-tmate
66119

67120
## BUILD ##############################################################################
68121
job-build:

.github/workflows/Matrix XP.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: WF test
1+
name: WF Test
22

33
on:
44
workflow_dispatch:

0 commit comments

Comments
 (0)