Add Java automation

Fetch Java versions with their dates from https://www.java.com/releases/.

This script is using a new dependency: requests-html (https://requests-html.kennethreitz.org/). This is because https://www.java.com/releases/ needs JavaScript to render correctly. And for this to work requests-html automatically downloads Chromium because of its dependency to pyppeteer.

Chromium is downloaded into PYPPETEER_HOME, so the workflow has been modified to set this directory as a subdirectory of ~/.cache. Note that declaring the same environment variable from the python script does not work.
This commit is contained in:
Marc Wrobel
2023-01-02 21:34:37 +01:00
parent a061e41789
commit 082b165d5d
4 changed files with 285 additions and 0 deletions

View File

@@ -58,6 +58,11 @@ jobs:
git config --global extensions.partialClone true
pip install -r requirements.txt
- name: Custom Updates
env:
# Add chromium downloaded by pyppeteer to the cache. See java.py for more information.
# Note that using we had to use /home/runner because using ~ does not work, despite what's
# explained in the https://github.com/actions/upload-artifact/tree/v2-preview#environment-variables-and-tilde-expansion.
PYPPETEER_HOME: /home/runner/.cache/pyppeteer
run: for i in src/*.py; do python $i;done
- name: Git and DockerHub Updates
run: bundle exec ruby update.rb ./website ~/.cache releases