Update psi-ms.obo (#351) #125
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: "Update OWL" | |
on: | |
push: | |
branches: [master] | |
jobs: | |
generate-owl: | |
if: ${{ ! contains(github.event.head_commit.message, 'Update OWL file') }} | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Extract version from OBO | |
run: | | |
CV_VERSION=`grep data-version psi-ms.obo | grep -oP "(\d+.\d+.\d+)"` | |
echo CV_VERSION=${CV_VERSION} | |
echo "CV_VERSION=${CV_VERSION}" >> $GITHUB_ENV | |
- name: Generate OWL | |
run: | | |
# Replace the imports of the UO and PATO ontology .obo files with the equivalent .owl files | |
cp psi-ms.obo tmp.obo | |
sed -e "s/pato.obo/pato.owl/g" -e "s/uo.obo/uo.owl/g" -i tmp.obo | |
head -n 50 tmp.obo | |
python -m pip install fastobo | |
python scripts/prepare_template.py tmp.obo cv_template.tsv | |
echo Generated template with `wc -l cv_template.tsv` | |
wget -nv --no-check-certificate https://github.com/ontodev/robot/releases/download/v1.9.5/robot.jar | |
export JAVA_TOOL_OPTIONS=-Xmx6G | |
# java -jar robot.jar -vvv template -p "PEFF: http://purl.obolibrary.org/obo/PEFF_" -i psi-ms.obo -t cv_template.tsv convert -f ofn -o psi-ms.owl | |
java -jar robot.jar convert -v -i tmp.obo -o psi-ms.owl --format owl | |
rm *robot.jar* | |
rm *tmp.obo* *cv_template.tsv* | |
- name: Create pull request | |
id: cpr | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
token: ${{ secrets.PSI_MS_CV_GITHUB_TOKEN }} | |
commit-message: Update OWL file | |
committer: GitHub <[email protected]> | |
author: GitHub <[email protected]> | |
branch: update-owl-file | |
delete-branch: true | |
title: Update OWL file | |
body: This automated PR updates the OWL file corresponding to the OBO file | |
- name: Approve pull request | |
if: (steps.cpr.outputs.pull-request-operation == 'created' || steps.cpr.outputs.pull-request-operation == 'updated') | |
uses: juliangruber/approve-pull-request-action@v1 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
number: ${{ steps.cpr.outputs.pull-request-number }} | |
- name: Merge pull request | |
if: (steps.cpr.outputs.pull-request-operation == 'created' || steps.cpr.outputs.pull-request-operation == 'updated') | |
uses: peter-evans/enable-pull-request-automerge@v3 | |
with: | |
token: ${{ secrets.PSI_MS_CV_GITHUB_TOKEN }} | |
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} | |
merge-method: squash | |
- name: GitHub Tag | |
id: new_tag | |
uses: mathieudutour/[email protected] | |
with: | |
github_token: ${{ secrets.PSI_MS_CV_GITHUB_TOKEN }} | |
pre_release_branches: test-tag | |
custom_tag: ${{ env.CV_VERSION }} |