~javiljoen/lttb-numpy

a4e4ff2885af56000a8a11a596619763347e7c8c — JA Viljoen 2 years ago c30defe
Add build script task to render & upload readme

Sourcehut only displays `README` or `README.md` by default.
Rst-formatted docs need to be compiled to HTML manually:
https://man.sr.ht/git.sr.ht/#setting-a-custom-readme
2 files changed, 16 insertions(+), 3 deletions(-)

M .build.yml
M CONTRIBUTING.rst
M .build.yml => .build.yml +15 -2
@@ 8,8 8,10 @@ packages:
  - python3-setuptools
  - python3-pytest
  - python3-hypothesis
sources:
  - https://git.sr.ht/~javiljoen/lttb-numpy
  - pandoc
  - curl
secrets:
  - 649dd5b6-9b5d-498a-b4ca-d17694af169b
tasks:
  - testpy2: |
      cd lttb-numpy


@@ 19,3 21,14 @@ tasks:
      cd lttb-numpy
      python3 setup.py install --user --quiet
      python3 -m pytest
  - readme: |
      cd lttb-numpy
      cat README.rst CONTRIBUTING.rst \
        | pandoc --no-highlight -f rst -o README.html
      set +x  # Avoid echoing the token
      curl -XPUT \
        -H "Authorization: Bearer $(cat ~/.readme-token)" \
        -H "Content-Type: text/html" \
        --data-binary @README.html \
        'https://git.sr.ht/api/repos/lttb-numpy/readme'
      echo "README successfully uploaded"

M CONTRIBUTING.rst => CONTRIBUTING.rst +1 -1
@@ 12,7 12,7 @@ Submitting patches
------------------

Patches are welcome.
Feel free to send them by email using `git send-email`,
Feel free to send them by email using ``git send-email``,
or you can send me a link to your repo if it is publically accessible.

Please ensure that the tests and linting checks listed in the ``Makefile`` all pass,