Update addons eudev #28
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Copyright (C) 2022 Ing <https://github.com/wjz304> | |
# | |
# This is free software, licensed under the MIT License. | |
# See /LICENSE for more information. | |
# | |
name: Update addons eudev | |
on: | |
workflow_dispatch: | |
inputs: | |
push: | |
description: "push" | |
default: false | |
type: boolean | |
jobs: | |
eudev: | |
strategy: | |
matrix: | |
include: | |
- arch: x86_64 | |
kver: 4.14.24 | |
- arch: x86_64 | |
kver: 5.10.60 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@main | |
- name: Checkout | |
uses: actions/checkout@main | |
with: | |
repository: RROrg/qr-addons | |
token: ${{ secrets.RRORG }} | |
path: qr-addons | |
- name: Init Env | |
run: | | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions[bot]" | |
sudo timedatectl set-timezone "Asia/Shanghai" | |
sudo apt update | |
sudo apt install libelf-dev automake autoconf libtool pkg-config | |
sudo apt install autopoint gettext bison | |
sudo apt install gperf xsltproc docbook-xsl docbook-xml | |
- name: Make eudev | |
run: | | |
sudo -s # use root to compile | |
export WORK_PATH=${{ github.workspace }} | |
. qr-addons/eudev/compile-eudev.sh | |
echo "----------------- Env -----------------" | |
KVER=${{ matrix.kver }} | |
makeEnvDeploy ${{ matrix.arch }} ${KVER%.*} | |
echo "----------------- Make -----------------" | |
makeeudev qr-addons/eudev/src output | |
- name: Tar to Artifacts | |
run: | | |
KVER=${{ matrix.kver }} | |
tar -zcf eudev-${KVER%%.*}.tgz -C output . | |
- name: Upload to Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: eudev-${{ matrix.arch }}-${{ matrix.kver }} | |
path: | | |
eudev-*.tgz | |
release: | |
runs-on: ubuntu-latest | |
needs: eudev | |
if: inputs.push == true | |
steps: | |
- name: Checkout | |
uses: actions/checkout@main | |
- name: Checkout | |
uses: actions/checkout@main | |
with: | |
repository: RROrg/qr-addons | |
token: ${{ secrets.RRORG }} | |
path: qr-addons | |
- name: Init Env | |
run: | | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions[bot]" | |
sudo timedatectl set-timezone "Asia/Shanghai" | |
- name: download to artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: output | |
pattern: eudev-* | |
merge-multiple: true | |
- name: delete-artifact | |
uses: geekyeggo/delete-artifact@v5 | |
with: | |
name: | | |
eudev-* | |
- name: Check and Push | |
run: | | |
if [ `ls eudev/*.tgz 2> /dev/null | wc -l` -gt 0 ]; then | |
echo "Copy eudev ..." | |
rm -rf qr-addons/eudev/all/addons/eudev*.tgz | |
mkdir -p qr-addons/eudev/all/addons/ | |
mv -f output/*.tgz qr-addons/eudev/all/addons/ | |
cd qr-addons | |
echo "Git push ..." | |
git pull | |
status=$(git status -s | grep -E 'eudev/all/addons/' | awk '{printf " %s", $2}') | |
if [ -n "${status}" ]; then | |
git add ${status} | |
git commit -m "update $(date +%Y-%m-%d" "%H:%M:%S)" | |
git push -f | |
fi | |
else | |
echo "No change ..." | |
fi |