Skip to content

Commit 734b69d

Browse files
add release workflow and update build
1 parent c65ef67 commit 734b69d

File tree

5 files changed

+85
-14
lines changed

5 files changed

+85
-14
lines changed

.github/workflows/build.yml

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
name: build
2-
2+
33
on:
44
workflow_dispatch:
55
push:
66
branches:
77
- master
8-
8+
99
jobs:
10-
deploy:
10+
build:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout code
1414
uses: actions/checkout@v4
1515

1616
- name: Install dependencies
17-
run: |
18-
sudo apt-get install -y raptor2-utils
17+
run: sudo apt-get install -y raptor2-utils
1918

2019
- name: Build
21-
run: ./build
22-
20+
run: scripts/combine | tee $GITHUB_STEP_SUMMARY
21+
2322
- name: Deploy
2423
uses: JamesIves/github-pages-deploy-action@v4
2524
with:

.github/workflows/release.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Release
2+
on:
3+
push:
4+
tags: '[2-9][0-9]\.[0-9][0-9]'
5+
jobs:
6+
create-release:
7+
name: Create release
8+
runs-on: ubuntu-latest
9+
outputs:
10+
upload_url: ${{ steps.create-release.outputs.upload_url }}
11+
steps:
12+
- name: Changelog
13+
id: changelog
14+
uses: mikepenz/release-changelog-builder-action@v4
15+
with:
16+
commitMode: true
17+
configurationJson: |
18+
{
19+
"pr_template": "- #{{TITLE}}",
20+
"template": "#{{UNCATEGORIZED}}"
21+
}
22+
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
26+
- name: Install dependencies
27+
run: sudo apt-get install -y raptor2-utils
28+
29+
- name: Build
30+
id: build
31+
run: |
32+
scripts/combine | tee $GITHUB_STEP_SUMMARY
33+
echo 'summary<<EOF' >> $GITHUB_OUTPUT
34+
cat ${GITHUB_STEP_SUMMARY} >> $GITHUB_OUTPUT
35+
echo 'EOF' >> $GITHUB_OUTPUT
36+
37+
- name: Create Release
38+
id: create-release
39+
uses: softprops/action-gh-release@v2
40+
with:
41+
body: |
42+
${{ steps.build.outputs.summary }}
43+
${{ steps.changelog.outputs.changelog }}
44+
files: |
45+
dist/hito.nt
46+
dist/hito.ttl
47+
dist/shacl.ttl

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ scripts/cluster/*.svg
66
scripts/cluster/tree
77
*.pdf
88
dist/hito.ttl
9+
dist/hito.nt
910
dist/shacl.ttl
1011
dist/all.ttl
1112
.env

build

-7
This file was deleted.

scripts/combine

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#/bin/sh
2+
# Combine all of HITO into one file.
3+
4+
MYPATH=`dirname "$0"`
5+
MYPATH=`( cd "$MYPATH" && pwd )`
6+
DISTPATH=$MYPATH/../dist
7+
mkdir -p $DISTPATH
8+
9+
#cat dbpedia/os.nt >> $F
10+
cd $MYPATH/..
11+
cat *.ttl | rapper -i turtle -o turtle - http://hitontology.eu/ontology/ > $DISTPATH/hito.ttl
12+
cp shacl.ttl dist/shacl.ttl
13+
14+
cd $DISTPATH
15+
cat hito.ttl dbpedia.ttl swo.ttl | rapper -i turtle -o turtle - http://hitontology.eu/ontology/ > all.ttl
16+
rapper -i turtle -o ntriples hito.ttl > hito.nt
17+
18+
echo "hito.ttl and hito.nt contain the HITO ontology, instances and SHACL shapes."
19+
printf "all.ttl additionally contains externally referenced resources from DBpedia and the Software Ontology (SWO).\n\n"
20+
echo "| Filename | triples | bytes | KiB | MiB | KB | MB |"
21+
echo "| --------- | ------- | ----- | --- | --- | -- | -- |"
22+
# "command ls" in case it is aliased to eza or something else, we need the exact ls output format
23+
command ls -l *.nt *.ttl | tr -s ' ' | cut -f5,9 -d ' ' | while read -r size filename; do
24+
triples=$(rapper -i turtle -c "$filename" 2>&1 | grep -o "[0-9]*")
25+
kib=$((size / 1000))
26+
mib=$((size / 1000000))
27+
kb=$((size / 1024))
28+
mb=$((size / 1024 / 1024))
29+
#echo "$size $filename"
30+
printf "| %11s | %11s | %12s | %9s | %7s | %9s |%7s |\n" $filename $triples $size $kib $mib $kb $mb
31+
done

0 commit comments

Comments
 (0)