diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml new file mode 100644 index 0000000..35b264d --- /dev/null +++ b/.github/workflows/update.yml @@ -0,0 +1,35 @@ +name: CI + +on: [push] + +jobs: + update: + env: + CONTROLS_FILENAME: controls_uba.txt + runs-on: ubuntu-latest + steps: + - name: Extract branch name + run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" + id: extract_branch + - name: Checkout Repostory + uses: actions/checkout@master + - name: update controls files + uses: fhem/fhem-controls-actions@master + with: + filename: controls_uba.txt + - name: update CHANGED + run: | + LOG=$(date +"%Y-%m-%d") + LOG+=" - $(git log -1 --pretty=%B)" + echo "$LOG" | cat - CHANGED > temp && mv temp CHANGED + - name: git commit back + run: | + git config --global user.email "action@github.com" + git config --local user.name "GitHub Action" + git add CHANGED controls_uba.txt || true + git log -1 --name-only --pretty=format: | grep -Eo '[0-9]{2}_.*.pm$' && git commit CHANGED controls_uba.txt -m "Automatic updated controls and CHANGED" || true + - name: git push + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ steps.extract_branch.outputs.branch }} \ No newline at end of file diff --git a/CHANGED b/CHANGED index 0bd5ea3..fff097b 100644 --- a/CHANGED +++ b/CHANGED @@ -1,3 +1,4 @@ +2021-03-28 - Added new build system Last uba updates (02.05.2020) e7f9a2b 02.05.2020 15:19 fixed controls diff --git a/build.sh b/build.sh deleted file mode 100755 index f131e86..0000000 --- a/build.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env bash - -module_file="FHEM/60_uba.pm" -commandref_de_source="CommandRef.de.md" -commandref_en_source="CommandRef.en.md" -meta_source="meta.json" -name="uba" -controls_file="controls_uba.txt" -changed_file="CHANGED" - -# +------------------------------------------------------------ -# -# Substitute the place holders in the module file with -# the converted markdown documentation -# -# +------------------------------------------------------------ -substitute() { - #echo "" >> .${commandref_de_source}.html - #pandoc -fmarkdown_github -t html ${commandref_de_source} | \ - # tidy -qi -w --show-body-only yes - >> .${commandref_de_source}.html - #echo "" >> .${commandref_de_source}.html - #sed -i -ne "/^=begin html_DE$/ {p; r .${commandref_de_source}.html" -e ":a; n; /^=end html_DE$/ {p; b}; ba}; p" ${module_file} - - #echo "" >> .${commandref_en_source}.html - #pandoc -fmarkdown_github -t html ${commandref_en_source} | \ - # tidy -qi -w --show-body-only yes - >> .${commandref_en_source}.html - #echo "" >> .${commandref_en_source}.html - #sed -i -ne "/^=begin html$/ {p; r .${commandref_en_source}.html" -e ":a; n; /^=end html$/ {p; b}; ba}; p" ${module_file} - - #sed -i -ne "/^=for :application\/json;q=META.json 59_Twilight.pm$/ {p; r ${meta_source}" -e ":a; n; /^=end :application\/json;q=META.json$/ {p; b}; ba}; p" ${module_file} - - # clean up - #rm -rf .CommandRef.* - - # add created files - git add FHEM/*.pm - #git add CommandRef.* - #git add meta.json -} - -#add_hooks() { -# rm -rf build/hooks/* -# cp -R .git/hooks/* build/hooks/ -# git add build/hooks/ -#} - -create_controlfile() { - rm ${controls_file} - find -type f \( -path './FHEM/*' -o -path './www/*' \) -print0 | while IFS= read -r -d '' f; - do - echo "DEL ${f}" >> ${controls_file} - out="UPD "$(stat -c %y $f | cut -d. -f1 | awk '{printf "%s_%s",$1,$2}')" "$(stat -c %s $f)" ${f}" - echo ${out//.\//} >> ${controls_file} - done - git add ${controls_file} -} - -update_changed() { - rm ${changed_file} - echo "Last $name updates ($(date +%d.%m.%Y))" > "${changed_file}" - echo "" >> ${changed_file} - git log -5 HEAD --pretty=" %h %ad %s" --date=format:"%d.%m.%Y %H:%M" FHEM/ >> ${changed_file} - git add CHANGED -} - -substitute -#add_hooks -# only create new controls file if FHEM/* is changed -test "$(git diff --cached --name-only --diff-filter=ACM | grep -c 'FHEM/')" -gt 0 && create_controlfile -update_changed diff --git a/controls_uba.txt b/controls_uba.txt index 47ae6d4..7c68365 100644 --- a/controls_uba.txt +++ b/controls_uba.txt @@ -1,2 +1 @@ -DEL ./FHEM/60_uba.pm -UPD 2020-04-14_01:25:59 19623 FHEM/60_uba.pm +UPD 2021-03-29_00:53:11 19623 FHEM/60_uba.pm