Merge branch 'gh-actions'

This commit is contained in:
Yuhao Zhou
2024-08-23 12:31:09 +08:00
5 changed files with 48 additions and 1 deletions

34
.github/workflows/build-truenas.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
name: Build kernel module for TrueNAS
on:
push:
branches:
- gh-actions
schedule:
- cron: "0 0 * * *"
jobs:
build-and-run:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository.
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: gh-actions
- name: Build the kernel modules
working-directory: build-scripts/truenas
run: bash build-all.sh
- name: Push results to GitHub
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Add compiled modules"
branch: gh-actions
file_pattern: 'build-scripts/truenas/build/*/*/led-ugreen.ko'

1
.gitignore vendored
View File

@@ -4,7 +4,6 @@ ugreen_leds_cli
run.sh run.sh
zpool_leds.sh zpool_leds.sh
*.ko
*.mod.c *.mod.c
*.o *.o
*.cmd *.cmd

View File

@@ -0,0 +1,12 @@
truenas_versions=$(curl https://download.truenas.com/ | grep -Po "(?<=href=\")TrueNAS-SCALE-\w*?/\d+(\.\d+)*" | uniq)
for version in ${truenas_versions}; do
# only build for TrueNAS-SCALE-Dragonfish/24.04.0 and later versions
if [ $(echo $version | grep -Po "(?<=/)\d+") -ge 24 ] && [ ! -d "build/$version" ]; then
echo Building "$version"
bash build.sh "$version"
fi
done
find -name *.ko

View File

@@ -1,3 +1,4 @@
set -x
url_prefix="https://download.truenas.com/$1/packages/" url_prefix="https://download.truenas.com/$1/packages/"

View File

@@ -1,3 +1,4 @@
set -x
if [[ ! -d ./build ]]; then if [[ ! -d ./build ]]; then
mkdir build mkdir build