Import changes from ebusd-configuration repository. #6
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 | |
- name: Checkout ebusd-configuration | |
uses: actions/checkout@v4 | |
with: | |
repository: john30/ebusd-configuration | |
ref: rework-normalize | |
path: repo | |
fetch-depth: 0 | |
- name: Use Node.js node 20.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20.x | |
- name: Install packages | |
run: npm install -omit=dev | |
working-directory: repo/ | |
- name: Convert typespec files (en) | |
run: npm run compile | |
working-directory: repo/ | |
- name: Convert typespec files (de) | |
run: npm run compile-de | |
working-directory: repo/ | |
- name: Move generated folders | |
run: | | |
ls -lah | |
shopt -s dotglob | |
chmod +x ./.github/workflows/*.sh | |
find repo/outcsv/@ebusd/ebus-typespec/ -type d -exec ./.github/workflows/genindex.sh \{\} \; | |
find repo/outcsv.de/@ebusd/ebus-typespec/ -type d -exec ./.github/workflows/genindex.sh \{\} \; | |
rm -rf de en | |
mkdir de en | |
mv repo/outcsv/@ebusd/ebus-typespec/* en/ | |
mv repo/outcsv.de/@ebusd/ebus-typespec/* de/ | |
- name: Generate mapping | |
run: | | |
cat mapping.md.tmpl > mapping.md | |
((cd repo/src/ && find . -type d) | xargs -L1 ./.github/workflows/genmapping.sh mapping.md repo/src) | |
- name: Remove repo folders | |
run: | | |
rm -rf repo | |
ls -lah de en | |
- 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 }} |