trying to fix build. #215
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
| --- | |
| # There are a bunch of README.adoc in this project. But we include:: to work. | |
| # Sadly not supported by github directly. | |
| # Place README-source.adoc instead. This action will find them, and 'reduce' them to have includes working. | |
| # And the result will be rendered correctly on github itself. | |
| # Sadly this can be a bit confusing, because readonly file not supportable. | |
| name: Reduce README | |
| on: | |
| push: | |
| branches: ['main'] | |
| workflow_dispatch: | |
| jobs: | |
| asciidoctor: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Asciidoctor Reducer | |
| run: sudo gem install asciidoctor-reducer coderay | |
| - name: Reduce README's | |
| run: | | |
| for source in README-source.adoc */README-source.adoc ; do | |
| dest="${source%-source.adoc}.adoc" | |
| echo "Reducing $source to $dest" | |
| asciidoctor-reducer --log-level debug -o $dest $source | |
| sed -i -e "1i // DO NOT EDIT THIS FILE, IT IS GENERATED!! (source: $source)" $dest | |
| done | |
| - name: Commit and Push README | |
| uses: EndBug/add-and-commit@v9 | |
| with: | |
| add: '["*README.adoc"]' |