processing-library-template icon indicating copy to clipboard operation
processing-library-template copied to clipboard

Github Pages integration

Open craftoid opened this issue 6 years ago • 1 comments

In case anyone wants to host their library page on github...

I created a fork, that does exactly that: https://github.com/bitcraftlab/processing-library-template

Here's what the library page looks like: https://bitcraftlab.github.io/processing-library-template/

Right now the approach is to publish YourLibrary.zip and YourLibrary.txt files using GitHub releases. To make sure they are always accessible at the same URL, you need to create a release labeled “latest” which needs to be manually updated: https://github.com/bitcraftlab/processing-library-template/releases/tag/latest

To host the page on github.io you need to activate github pages, and configure it to serve the page from the master:docs folder.

  • If you setproject.dist.platform=GitHub in the build.properties file, the docs folder is created upon build, and index.html will link the zip file on github.
  • If you set project.dist.platform=Webyou get default behaviour

Question:

@prisonerjohn could you check if YourLibrary.txt can be harvested by the processing.org script that checks for updates? There's some redirection going on, but if this is resolved it should work:

curl -L https://github.com/bitcraftlab/processing-library-template/releases/download/latest/YourLibrary.txt

craftoid avatar Feb 09 '19 18:02 craftoid

I used another approach. I just added a .travis.yml file and use travis to build and deploy to GitHub pages.

language: java
jdk:
 - openjdk8

script:
  - ant -f resources/build.xml

before_install:
  - wget http://central.maven.org/maven2/org/processing/core/3.2.3/core-3.2.3.jar
  - sudo mkdir -p /opt/processing/core/library/
  - sudo mv core-3.2.3.jar /opt/processing/core/library/core.jar
  - mkdir -p /home/travis/sketchbook/libraries
  - wget https://github.com/processing/processing-sound/releases/download/v2.0.2/sound.zip
  - unzip sound.zip -d /home/travis/sketchbook/libraries

deploy:
  provider: pages
  skip_cleanup: true
  github-token: $GITHUB_TOKEN
  local-dir: distribution/scratch-latest/
  on:
    branch: master

See https://github.com/mikebarkmin/processing-library-scratch for the project repo in which Travis is used.

mikebarkmin avatar Oct 23 '19 08:10 mikebarkmin