Import changes from ebusd-configuration repository. #9
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
name: Import changes from ebusd-configuration repository. | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
submodules: true | |
- name: Use Node.js node 20.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20.x | |
- name: check | |
run: | | |
pwd | |
ls -lah | |
- name: Install packages | |
run: npm install -omit=dev | |
working-directory: ebusd-configuration/ | |
- name: Convert typespec files (en) | |
run: npm run compile | |
working-directory: ebusd-configuration/ | |
- name: Convert typespec files (de) | |
run: npm run compile-de | |
working-directory: ebusd-configuration/ | |
- name: Move generated folders | |
run: | | |
ls -lah | |
shopt -s dotglob | |
chmod +x ./.github/workflows/*.sh | |
find ebusd-configuration/outcsv/@ebusd/ebus-typespec/ -type d -exec ./.github/workflows/genindex.sh \{\} \; | |
find ebusd-configuration/outcsv.de/@ebusd/ebus-typespec/ -type d -exec ./.github/workflows/genindex.sh \{\} \; | |
[[ -f de/versions.json ]] && mv de/versions.json de-versions.json | |
[[ -f en/versions.json ]] && mv en/versions.json en-versions.json | |
rm -rf de en | |
mkdir de en | |
mv ebusd-configuration/outcsv/@ebusd/ebus-typespec/* en/ | |
mv ebusd-configuration/outcsv.de/@ebusd/ebus-typespec/* de/ | |
[[ -f de-versions.json ]] && mv de-versions.json de/versions.json | |
[[ -f en-versions.json ]] && mv en-versions.json en/versions.json | |
- name: Generate mapping | |
run: | | |
cat mapping.md.tmpl > mapping.md | |
((cd ebusd-configuration/src/ && find . -type d) | xargs -L1 ./.github/workflows/genmapping.sh mapping.md ebusd-configuration/src) | |
- name: Generate versions | |
run: | | |
./.github/workflows/genversions.sh en | |
./.github/workflows/genversions.sh de | |
- name: Commit files | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add de en mapping.md | |
git commit -a -m "import changes from ebusd-configuration" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} |