Skip to content

Commit 6635a8d

Browse files
author
Hanke
committed
initial commit
0 parents  commit 6635a8d

7 files changed

Lines changed: 502 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Basic ODK workflow
2+
3+
name: build
4+
5+
# Controls when the action will run.
6+
on:
7+
# Triggers the workflow on push or pull request events but only for the main branch
8+
push:
9+
branches: [*]
10+
pull_request:
11+
branches: [*]
12+
13+
# Allows you to run this workflow manually from the Actions tab
14+
workflow_dispatch:
15+
16+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
17+
jobs:
18+
# This workflow contains a single job called "ontology_qc"
19+
ontology_qc:
20+
# The type of runner that the job will run on
21+
runs-on: ubuntu-latest
22+
container: obolibrary/odkfull:v1.6
23+
24+
# Steps represent a sequence of tasks that will be executed as part of the job
25+
steps:
26+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
27+
- uses: actions/checkout@v4
28+
29+
- name: Build ontology
30+
env:
31+
DEFAULT_BRANCH: main
32+
run: cd src/ontology && make refresh-imports all_assets ROBOT_ENV='ROBOT_JAVA_ARGS=-Xmx6G'
33+
- name: Commit files # commit the src folder
34+
uses: EndBug/add-and-commit@v9
35+
with:
36+
message: "updated ontology"
37+
add: "*.* --force"
38+
cwd: "./src/"
39+
default_author: github_actions

.github/workflows/docs.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
2+
name: create widoco documentation
3+
4+
on:
5+
# Runs on pushes targeting the default branch
6+
push:
7+
branches: ["main"]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20+
concurrency:
21+
group: "pages"
22+
cancel-in-progress: false
23+
24+
jobs:
25+
# Check job
26+
check:
27+
runs-on: ubuntu-latest
28+
outputs:
29+
ontology-exists: ${{ steps.check.outputs.exists }}
30+
ontology-file: ${{ steps.check.outputs.file }}
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
- name: Check for ontology file
35+
id: check
36+
run: |
37+
ONTOLOGY_FILE=$(find src/ontology/ -name "*-full.owl" -type f | head -1)
38+
if [ -z "$ONTOLOGY_FILE" ]; then
39+
echo "No *-full.owl file found in src/ontology/ directory."
40+
echo "exists=false" >> $GITHUB_OUTPUT
41+
else
42+
echo "Found ontology file: $ONTOLOGY_FILE"
43+
echo "exists=true" >> $GITHUB_OUTPUT
44+
echo "file=$ONTOLOGY_FILE" >> $GITHUB_OUTPUT
45+
fi
46+
47+
# Build job
48+
build:
49+
runs-on: ubuntu-latest
50+
needs: check
51+
if: needs.check.outputs.ontology-exists == 'true'
52+
steps:
53+
- name: Checkout
54+
uses: actions/checkout@v4
55+
- name: Setup Pages
56+
uses: actions/configure-pages@v5
57+
- name: Build HTML for main
58+
run: |
59+
wget -O widoco.jar https://github.com/dgarijo/Widoco/releases/download/v1.4.25/widoco-1.4.25-jar-with-dependencies_JDK-11.jar
60+
mkdir ./_site
61+
java -jar widoco.jar -ontFile ${{ needs.check.outputs.ontology-file }} -outFolder ./_site -uniteSections -includeAnnotationProperties -lang en-de -getOntologyMetadata -noPlaceHolderText -rewriteAll -webVowl
62+
- name: add default entry point
63+
run: |
64+
cp ./_site/index-en.html ./_site/index.html
65+
- name: Upload artifact
66+
uses: actions/upload-pages-artifact@v3
67+
68+
# Deployment job
69+
deploy:
70+
environment:
71+
name: github-pages
72+
url: ${{ steps.deployment.outputs.page_url }}
73+
runs-on: ubuntu-latest
74+
needs: build
75+
steps:
76+
- name: Deploy to GitHub Pages
77+
id: deployment
78+
uses: actions/deploy-pages@v4

.github/workflows/seed.yml

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# SEEDING ODK workflow
2+
3+
name: seed odk
4+
5+
# Controls when the action will run.
6+
on:
7+
# Allows you to run this workflow manually from the Actions tab
8+
workflow_dispatch:
9+
inputs:
10+
ontology_id:
11+
description: 'Ontology ID (replaces id in seed.yaml)'
12+
required: true
13+
uribase_suffix:
14+
description: 'URI base suffix (replaces uribase_suffix in seed.yaml)'
15+
required: true
16+
odk_tag:
17+
description: 'ODK Docker tag to use'
18+
required: false
19+
default: 'latest'
20+
config_file:
21+
description: 'Configuration file name'
22+
required: false
23+
default: 'seed-template.yaml'
24+
25+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
26+
jobs:
27+
# This workflow contains a single job called "seed_ontology"
28+
seed_ontology:
29+
# The type of runner that the job will run on
30+
runs-on: ubuntu-latest
31+
container: obolibrary/odkfull:${{ github.event.inputs.odk_tag || 'latest' }}
32+
33+
# Steps represent a sequence of tasks that will be executed as part of the job
34+
steps:
35+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
36+
- uses: actions/checkout@v4
37+
38+
- name: Set up Git config
39+
run: |
40+
git config --global user.name "${{ github.actor }}"
41+
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
42+
43+
- name: Generate unique branch name
44+
run: |
45+
BRANCH_NAME="fresh-seed-$(date +%Y%m%d-%H%M%S)"
46+
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
47+
48+
- name: Verify seed config file exists
49+
run: |
50+
if [ ! -f "${{ github.event.inputs.config_file || 'seed-template.yaml' }}" ]; then
51+
echo "Error: Configuration file ${{ github.event.inputs.config_file || 'seed-template.yaml' }} not found!"
52+
exit 1
53+
fi
54+
echo "Using configuration file: ${{ github.event.inputs.config_file || 'seed-template.yaml' }}"
55+
56+
- name: Update seed-template.yaml with input values
57+
run: |
58+
CONFIG_FILE="${{ github.event.inputs.config_file || 'seed-template.yaml' }}"
59+
60+
echo "Original seed-template.yaml content:"
61+
cat "$CONFIG_FILE"
62+
63+
# Replace id value
64+
sed -i "s/^id:.*/id: ${{ github.event.inputs.ontology_id }}/" "$CONFIG_FILE"
65+
66+
# Replace uribase_suffix value
67+
sed -i "s/^uribase_suffix:.*/uribase_suffix: ${{ github.event.inputs.uribase_suffix }}/" "$CONFIG_FILE"
68+
69+
echo "Updated seed-template.yaml content:"
70+
cat "$CONFIG_FILE"
71+
72+
- name: Run ODK seed
73+
env:
74+
ODK_IMAGE: odkfull
75+
ODK_TAG: ${{ github.event.inputs.odk_tag || 'latest' }}
76+
ODK_GITNAME: ${{ github.actor }}
77+
ODK_GITEMAIL: ${{ github.actor }}@users.noreply.github.com
78+
run: |
79+
echo "This script only works with ODK 1.3.2 and later. For ODK 1.3.1 or earlier, use https://raw.githubusercontent.com/INCATools/ontology-development-kit/v1.3.1/seed-via-docker.sh"
80+
/tools/odk.py seed \
81+
--gitname "$ODK_GITNAME" \
82+
--gitemail "$ODK_GITEMAIL" \
83+
-c \
84+
-C ${{ github.event.inputs.config_file || 'seed-template.yaml' }}
85+
86+
- name: Copy generated files to root
87+
run: |
88+
TARGET_DIR="target/${{ github.event.inputs.ontology_id }}"
89+
if [ ! -d "$TARGET_DIR" ]; then
90+
echo "Error: Target directory $TARGET_DIR not found!"
91+
exit 1
92+
fi
93+
94+
echo "Copying files from $TARGET_DIR to root, excluding .git and .github directories..."
95+
96+
# Copy all files and directories except .git and .github
97+
find "$TARGET_DIR" -mindepth 1 -maxdepth 1 ! -name '.git' ! -name '.github' -exec cp -r {} . \;
98+
99+
# List what was copied
100+
echo "Files copied to root:"
101+
ls -la
102+
103+
- name: Clean up target directory
104+
run: |
105+
echo "Removing target directory to avoid git conflicts..."
106+
rm -rf target/
107+
git status
108+
109+
- name: Create Pull Request
110+
uses: peter-evans/create-pull-request@v5
111+
with:
112+
branch: ${{ env.BRANCH_NAME }}
113+
base: main
114+
title: "ODK Seed: ${{ github.event.inputs.ontology_id }}"
115+
commit-message: "ODK seed generated files for ${{ github.event.inputs.ontology_id }} using ${{ github.event.inputs.config_file || 'seed.yaml' }}"
116+
body: |
117+
## ODK Seed Generated Files
118+
119+
- **Ontology ID**: `${{ github.event.inputs.ontology_id }}`
120+
- **URI Base Suffix**: `${{ github.event.inputs.uribase_suffix }}`
121+
- **Config File**: `${{ github.event.inputs.config_file || 'seed-template.yaml' }}`
122+
- **ODK Tag**: `${{ github.event.inputs.odk_tag || 'latest' }}`
123+
124+
This PR contains the generated ontology files from ODK seed.

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# ODK-managed rules, do not modify
2+
# If you need to add your own ignore rules, you may do so below
3+
# the "End ODK-managed rules" marker at the end of this file.
4+
.DS_Store
5+
semantic.cache
6+
bin/
7+
.trunk/
8+
*.tmp
9+
*.tmp.obo
10+
*.tmp.owl
11+
*.tmp.json
12+
*-relation-graph.tsv.gz
13+
.template.db
14+
15+
.github/token.txt

0 commit comments

Comments
 (0)