action.yaml 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. name: watcher
  2. description: Install e-dant/watcher
  3. runs:
  4. using: composite
  5. steps:
  6. - name: Determine e-dant/watcher version
  7. id: determine-watcher-version
  8. run: echo version="$(gh release view --repo e-dant/watcher --json tagName --template '{{ .tagName }}')" >> "${GITHUB_OUTPUT}"
  9. shell: bash
  10. env:
  11. GH_TOKEN: ${{ github.token }}
  12. - name: Cache e-dant/watcher
  13. id: cache-watcher
  14. uses: actions/cache@v4
  15. with:
  16. path: watcher/target
  17. key: watcher-${{ runner.os }}-${{ runner.arch }}-${{ steps.determine-watcher-version.outputs.version }}-${{ env.CC && env.CC || 'gcc' }}
  18. - if: steps.cache-watcher.outputs.cache-hit != 'true'
  19. name: Compile e-dant/watcher
  20. run: |
  21. mkdir watcher
  22. gh release download --repo e-dant/watcher -A tar.gz -O - | tar -xz -C watcher --strip-components 1
  23. cd watcher
  24. cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
  25. cmake --build build
  26. sudo cmake --install build --prefix target
  27. shell: bash
  28. env:
  29. GH_TOKEN: ${{ github.token }}
  30. - name: Update LD_LIBRARY_PATH
  31. run: |
  32. sudo sh -c "echo ${PWD}/watcher/target/lib > /etc/ld.so.conf.d/watcher.conf"
  33. sudo ldconfig
  34. shell: bash