Merge pull request #1 from BrickSchema/supporting-multiple-versions #12
This file contains 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
name: Build and Run NPM Package | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
build-and-run: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Remote Repository | |
uses: actions/checkout@v3 | |
- name: Clone RDF toolkit | |
run: git clone https://github.com/KrishnanN27/rdf-toolkit | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
- name: Install Dependencies | |
working-directory: rdf-toolkit | |
run: | | |
npm ci | |
- name: Build NPM Package | |
working-directory: rdf-toolkit | |
run: | | |
npm run build | |
npm i @rdf-toolkit/cli | |
- name: Copy ontologies | |
run: | | |
cp -r ontologies/* rdf-toolkit/explorer/vocab/ | |
ls rdf-toolkit/explorer/vocab | |
- name: Copy config file | |
run: cp rdfconfig.json rdf-toolkit/explorer/ | |
- name: Build site | |
working-directory: rdf-toolkit/explorer | |
run: | | |
npx rdf add file "https://brickschema.org/schema/1.4/Brick" vocab/brick/latest/Brick.ttl | |
npx rdf add file "http://qudt.org/2.1/schema/shacl/qudt" vocab/SCHEMA_QUDT_NoOWL-v2.1.ttl | |
npx rdf add file "http://qudt.org/2.1/vocab/unit" vocab/VOCAB_QUDT-UNITS-ALL-v2.1.ttl | |
npx rdf add file "http://qudt.org/2.1/vocab/quantitykind" vocab/VOCAB_QUDT-QUANTITY-KINDS-ALL-v2.1.ttl | |
npx rdf add file "http://www.w3.org/ns/shacl" vocab/shacl.ttl | |
npx rdf add file "https://brickschema.org/schema/Brick/ref" vocab/ref-schema.ttl | |
npx rdf add file "https://w3id.org/rec" vocab/rec.ttl | |
npx rdf make site --output public | |
- name: handle brick 1.3 | |
working-directory: rdf-toolkit/explorer | |
run: | | |
git checkout package.json | |
npx rdf add file "https://brickschema.org/schema/1.3/Brick" vocab/brick/1.3/Brick.ttl | |
npx rdf make site --output public/1.3 | |
- name: handle brick 1.4 | |
working-directory: rdf-toolkit/explorer | |
run: | | |
git checkout package.json | |
npx rdf add file "https://brickschema.org/schema/1.4/Brick" vocab/brick/1.4/Brick.ttl | |
npx rdf make site --output public/1.4 | |
- name: Commit Built Files | |
run: | | |
rm -rf html.explorer | |
mv rdf-toolkit/explorer/public html.explorer | |
git config user.name "GitHub Action" | |
git config user.email "[email protected]" | |
git add html.explorer | |
git diff --quiet --exit-code || git commit -m "Commit built files" && git push | |
- name: Setup Pages | |
uses: actions/configure-pages@v3 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: 'html.explorer/' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |