Sync headers from upstream repository (brew) #7
This file contains hidden or 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
| # SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org> | |
| # | |
| # SPDX-License-Identifier: MPL-2.0 | |
| name: Sync headers from upstream repository (brew) | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 2 * * *" # Based on UTC time | |
| jobs: | |
| sync-headers: | |
| name: "Sync headers from upstream repository (brew)" | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| architecture: x64 | |
| - name: Install dependencies | |
| run: pip install build | |
| - name: Enable brew | |
| run: echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH | |
| - name: Install brew | |
| run: | | |
| brew install nlohmann-json boost eigen msgpack-cxx | |
| - name: copy headers | |
| run: | | |
| cp -r /home/linuxbrew/.linuxbrew/Cellar/nlohmann-json/*/* src/pgm_build_dependencies/nlohmann_json/ | |
| cp -r /home/linuxbrew/.linuxbrew/Cellar/boost/*/* src/pgm_build_dependencies/boost/ | |
| cp -r /home/linuxbrew/.linuxbrew/Cellar/eigen/*/* src/pgm_build_dependencies/eigen/ | |
| cp -r /home/linuxbrew/.linuxbrew/Cellar/msgpack-cxx/*/* src/pgm_build_dependencies/msgpack_cxx/ | |
| find src/ \( -type f ! -exec grep -Iq . {} \; -o -type l \) -delete | |
| ls src/pgm_build_dependencies/nlohmann_json/ | |
| ls src/pgm_build_dependencies/boost/ | |
| ls src/pgm_build_dependencies/eigen/ | |
| ls src/pgm_build_dependencies/msgpack_cxx/ | |
| - name: Commit and push changes | |
| uses: stefanzweifel/git-auto-commit-action@v6 | |
| with: | |
| commit_message: Update the headers | |
| commit_options: '--signoff' | |
| commit_user_name: GitHub Actions Bot | |
| commit_user_email: actions@github.com | |
| commit_author: GitHub Actions Bot <actions@github.com> |