Merge pull request #2 from althonos/main #2
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: generate-owl-tag-release | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
# events but only for the master branch | |
on: | |
push: | |
branches: | |
- master | |
- main | |
- test-tag | |
paths: | |
- 'XLMOD.obo' | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Extract version from OBO | |
run: | | |
CV_VERSION=`grep data-version XLMOD.obo | grep -oP "(\d+.\d+.\d+)"` | |
echo CV_VERSION=${CV_VERSION} | |
echo "CV_VERSION=${CV_VERSION}" >> $GITHUB_ENV | |
- name: Generate OWL and Commit | |
run: | | |
docker pull obolibrary/robot:v1.8.1 | |
# Replace the imports of the UO and PATO ontology .obo files with the equivalent .owl files | |
cp XLMOD.obo tmp.obo | |
sed -e "s/pato.obo/pato.owl/g" -e "s/uo.obo/uo.owl/g" -i tmp.obo | |
docker run --rm -v ${{ github.workspace }}:/work obolibrary/robot:v1.8.1 robot convert -i /work/tmp.obo -o /work/XLMOD.owl --format owl | |
rm tmp.obo | |
git config --global user.name 'XLMOD CV Bot' | |
git config --global user.email 'mobiusklein@users.noreply.github.com' | |
OWL_CHANGE=`git diff XLMOD.owl` | |
if [ -z "$OWL_CHANGE" ] | |
then | |
echo OWL did not change, aborting | |
exit 1 | |
else | |
echo OWL updated, committing and proceeding to tag | |
git add XLMOD.owl | |
git commit -m "Generate OWL file" | |
git push | |
fi | |
- name: GitHub Tag | |
id: new_tag | |
uses: mathieudutour/github-tag-action@v5.6 | |
with: | |
github_token: ${{ secrets.PSI_MS_CV_GITHUB_TOKEN }} | |
pre_release_branches: test-tag | |
custom_tag: ${{ env.CV_VERSION }} | |
- name: Create a GitHub release | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: v${{ env.CV_VERSION }} | |
name: Release v${{ env.CV_VERSION }} | |
body: ${{ steps.new_tag.outputs.changelog }} | |
artifacts: "XLMOD.obo,XLMOD.owl" | |
generateReleaseNotes: true | |
token: ${{ secrets.PSI_MS_CV_GITHUB_TOKEN }} |