Skip to content

Commit

Permalink
add release workflow and update build
Browse files Browse the repository at this point in the history
  • Loading branch information
KonradHoeffner committed Mar 22, 2024
1 parent c65ef67 commit 734b69d
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 14 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
name: build

on:
workflow_dispatch:
push:
branches:
- master

jobs:
deploy:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get install -y raptor2-utils
run: sudo apt-get install -y raptor2-utils

- name: Build
run: ./build
run: scripts/combine | tee $GITHUB_STEP_SUMMARY

- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Release
on:
push:
tags: '[2-9][0-9]\.[0-9][0-9]'
jobs:
create-release:
name: Create release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create-release.outputs.upload_url }}
steps:
- name: Changelog
id: changelog
uses: mikepenz/release-changelog-builder-action@v4
with:
commitMode: true
configurationJson: |
{
"pr_template": "- #{{TITLE}}",
"template": "#{{UNCATEGORIZED}}"
}
- name: Checkout code
uses: actions/checkout@v4

- name: Install dependencies
run: sudo apt-get install -y raptor2-utils

- name: Build
id: build
run: |
scripts/combine | tee $GITHUB_STEP_SUMMARY
echo 'summary<<EOF' >> $GITHUB_OUTPUT
cat ${GITHUB_STEP_SUMMARY} >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
- name: Create Release
id: create-release
uses: softprops/action-gh-release@v2
with:
body: |
${{ steps.build.outputs.summary }}
${{ steps.changelog.outputs.changelog }}
files: |
dist/hito.nt
dist/hito.ttl
dist/shacl.ttl
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ scripts/cluster/*.svg
scripts/cluster/tree
*.pdf
dist/hito.ttl
dist/hito.nt
dist/shacl.ttl
dist/all.ttl
.env
Expand Down
7 changes: 0 additions & 7 deletions build

This file was deleted.

31 changes: 31 additions & 0 deletions scripts/combine
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#/bin/sh
# Combine all of HITO into one file.

MYPATH=`dirname "$0"`
MYPATH=`( cd "$MYPATH" && pwd )`
DISTPATH=$MYPATH/../dist
mkdir -p $DISTPATH

#cat dbpedia/os.nt >> $F
cd $MYPATH/..
cat *.ttl | rapper -i turtle -o turtle - http://hitontology.eu/ontology/ > $DISTPATH/hito.ttl
cp shacl.ttl dist/shacl.ttl

cd $DISTPATH
cat hito.ttl dbpedia.ttl swo.ttl | rapper -i turtle -o turtle - http://hitontology.eu/ontology/ > all.ttl
rapper -i turtle -o ntriples hito.ttl > hito.nt

echo "hito.ttl and hito.nt contain the HITO ontology, instances and SHACL shapes."
printf "all.ttl additionally contains externally referenced resources from DBpedia and the Software Ontology (SWO).\n\n"
echo "| Filename | triples | bytes | KiB | MiB | KB | MB |"
echo "| --------- | ------- | ----- | --- | --- | -- | -- |"
# "command ls" in case it is aliased to eza or something else, we need the exact ls output format
command ls -l *.nt *.ttl | tr -s ' ' | cut -f5,9 -d ' ' | while read -r size filename; do
triples=$(rapper -i turtle -c "$filename" 2>&1 | grep -o "[0-9]*")
kib=$((size / 1000))
mib=$((size / 1000000))
kb=$((size / 1024))
mb=$((size / 1024 / 1024))
#echo "$size $filename"
printf "| %11s | %11s | %12s | %9s | %7s | %9s |%7s |\n" $filename $triples $size $kib $mib $kb $mb
done

0 comments on commit 734b69d

Please sign in to comment.