Skip to content

Commit

Permalink
ci: add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
KonradHoeffner committed Mar 21, 2024
1 parent 4fbe0ec commit ae4cd20
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 10 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: build

on:
workflow_dispatch:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -14,9 +14,14 @@ jobs:
uses: actions/checkout@v4

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

- name: Build
run: source ./scripts/combine

- name: Build and Validate
run: ./scripts/shacl
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: dist
folder: dist
single-commit: true
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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: Build Changelog
id: build-changelog
uses: mikepenz/release-changelog-builder-action@v4
with:
commitMode: true
configurationJson: |
{
"pr_template": "- #{{TITLE}}"
}
- name: Checkout code
uses: actions/checkout@v4

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

# don't validate here because there is a separate SHACL action and there are unvalidated parts of SNIK that would fail the release
- name: Build
run: ./scripts/combine

- name: Create Release
id: create-release
uses: softprops/action-gh-release@v2
with:
body: ${{steps.build-changelog.outputs.changelog}}
files: |
dist/snik.nt
dist/snik.ttl
6 changes: 3 additions & 3 deletions .github/workflows/shacl.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
name: SHACL

on:
workflow_dispatch:
push:
branches:
- master

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

- name: Build and Validate
- name: Validate
uses: konradhoeffner/shacl@v1
with:
data: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*~
.*
dist
!.github
1 change: 1 addition & 0 deletions scripts/combine
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ DISTPATH=$MYPATH/../dist
mkdir -p $DISTPATH
cat $MYPATH/../*.ttl $MYPATH/../*.nt | rapper -i turtle -o turtle - http://www.snik.eu/ontology/ > $DISTPATH/snik.ttl
cd $DISTPATH
rapper -i turtle -o ntriples snik.ttl > snik.nt
GITHUB_STEP_SUMMARY="`wc -l snik.nt | cut -f1 -d ' '` triples \n\n"
if type awk > /dev/null 2>&1; then
GITHUB_STEP_SUMMARY+="| Filename | bytes | KiB | MiB | KB | MB |\n"
Expand Down

0 comments on commit ae4cd20

Please sign in to comment.