Skip to content

Commit

Permalink
Update spec-parser.yml
Browse files Browse the repository at this point in the history
- add action to commit model.ttl
  • Loading branch information
meretp committed May 17, 2023
1 parent 029a2d9 commit cf5b97c
Showing 1 changed file with 30 additions and 12 deletions.
42 changes: 30 additions & 12 deletions .github/workflows/spec-parser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ jobs:
build:

runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write

steps:
- uses: actions/checkout@v3
Expand All @@ -34,23 +38,37 @@ jobs:
--gen-rdf \
--out-dir /tmp/spec-parser.out \
../model
cd ..
- uses: actions/upload-artifact@v3
with:
name: model.ttl
path: /tmp/spec-parser.out/model.ttl

- name: get Ontospy
run: |
git clone --depth=1 --single-branch --branch=master https://github.com/lambdamusic/Ontospy.git
cd Ontospy
python3 -m pip install -r requirements.txt
python3 -m pip install -e .
- name: generate docs with Ontospy
run : |
cd Ontospy
mkdir -p /tmp/generated_docs
ontospy gendocs -o /tmp/generated_docs --type 2 --title SPDX-3.0 /tmp/spec-parser.out/model.ttl
cd ..
- uses: actions/upload-artifact@v3
with:
name: spec-parser.out
path: /tmp/spec-parser.out

- uses: cachix/install-nix-action@v19
with:
nix_path: nixpkgs=channel:nixos-unstable
- run: nix-shell '<nixpkgs>' --fallback -p apache-jena --run "riot --out=jsonld /tmp/spec-parser.out/model.ttl" > /tmp/spec-parser.out/model.jsonld

- uses: actions/upload-artifact@v3
with:
name: model.jsonld
path: /tmp/spec-parser.out/model.jsonld
name: generated_docs
path: /tmp/generated_docs
- name: commit changes to branch
run: |
git fetch
git checkout gh-pages
cp /tmp/spec-parser.out/model.ttl .
cp -r /tmp/generated_docs/ .
git add model.ttl generated_docs/
git -c user.name="github-actions[bot]" -c user.email="41898282+github-actions[bot]@users.noreply.github.com" commit -s -m "Automated Upload" --author "${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>"
git push origin

0 comments on commit cf5b97c

Please sign in to comment.