Restructure licensing profile #484
Workflow file for this run
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: run spec-parser | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
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 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: get spec-parser | |
run: | | |
git clone --depth=1 --single-branch --branch=main https://github.com/spdx/spec-parser/ | |
cd spec-parser | |
python3 -m pip install -r requirements.txt | |
python main.py -h | |
- name: run spec-parser | |
run: | | |
cd spec-parser | |
mkdir -p /tmp/spec-parser.out | |
python main.py \ | |
--gen-md \ | |
--gen-refs \ | |
--gen-rdf \ | |
--out-dir /tmp/spec-parser.out \ | |
../model | |
- 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/auto-generated | |
ontospy gendocs -o /tmp/auto-generated --type 2 --title SPDX-3.0 /tmp/spec-parser.out/model.ttl | |
mkdir -p /tmp/auto-generated/one_pager | |
ontospy gendocs -o /tmp/auto-generated/one_pager --type 1 --title SPDX-3.0 /tmp/spec-parser.out/model.ttl | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: auto-generated | |
path: /tmp/auto-generated | |
- name: commit changes to branch | |
if: github.ref_name == 'main' | |
run: | | |
git fetch | |
git checkout gh-pages | |
rm -rf /auto-generated/ | |
cp /tmp/spec-parser.out/model.ttl . | |
cp -r /tmp/auto-generated/ . | |
if [ -n "$(git status -s -- "auto-generated/" "*.ttl")" ] | |
then | |
git add model.ttl auto-generated/ | |
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 | |
fi |