-
Notifications
You must be signed in to change notification settings - Fork 3
55 lines (54 loc) · 2.07 KB
/
drawiotordf.yml
File metadata and controls
55 lines (54 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: DrawioToRdf
on:
push:
paths:
- methods/**
workflow_dispatch:
jobs:
chowlk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Check changed files
id: diff
run: |
# See https://github.community/t/check-pushed-file-changes-with-git-diff-tree-in-github-actions/17220/10
export DIFF=$(git diff --name-only ${{ github.event.before }}..${{ github.event.after }} methods/*.drawio)
echo "$DIFF"
# Escape newlines (replace \n with %0A)
echo "::set-output name=diff::$( echo "$DIFF" | sed ':a;N;$!ba;s/\n/%0A/g' )"
- name: clone Chowlk and install requirements
#working-directory: ./methods
# if: ${{ steps.diff.outputs.diff }}
run: |
echo "${{ steps.diff.outputs.diff }}"
git clone https://github.com/oeg-upm/Chowlk
- name: Setup Python install requirments
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: 'pip' # caching pip dependencies
- name: Install requirments
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r Chowlk/requirements.txt
- name: convert drawio to rdf
if: ${{ steps.diff.outputs.diff }}
run: |
for file in ${{ steps.diff.outputs.diff }}; do python Chowlk/converter.py "$file" "$file".ttl --type ontology --format ttl; done
- name: Commit files # commit the output folder
if: ${{ steps.diff.outputs.diff }}
run: |
git config --local user.email "chowlk.action@github.com"
git config --local user.name "Chowlk Action"
git add methods/\*
git commit -m "converted changed drawio files"
- name: Push changes # push the output folder to your repo
if: ${{ steps.diff.outputs.diff }}
uses: ad-m/github-push-action@master
with:
#branch: main #ignore if your branch is master
github_token: ${{ secrets.GITHUB_TOKEN }}
force: true