Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workflow to auto-generate model artifacts upon merging PR #197

Merged
merged 1 commit into from
Jun 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/generate-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#######################################################################
# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This work is made available under the terms of the
# Creative Commons Attribution 4.0 International (CC-BY-4.0) license,
# which is available at
# https://creativecommons.org/licenses/by/4.0/legalcode.
#
# SPDX-License-Identifier: CC-BY-4.0
#######################################################################

name: Generate Model Artifacts

on:
push:
branches:
- main

jobs:
generate-model-artifacts:
name: 02 Generate model artifacts
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check Changes
id: changes
uses: Ana06/[email protected]
with:
format: csv
filter: "*.ttl"
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: '17'
- name: Generate artifacts for new models
run: |
mapfile -d ',' -t added_modified_files < <(printf '%s,' '${{ steps.changes.outputs.added_modified }}')
for added_modified_file in "${added_modified_files[@]}"; do
echo "Generate model artifacts for ${added_modified_file}."
./generate.sh ${added_modified_file}
done
- name: Commit new artifacts
run: |
git config --global user.name "GitHub Actions Bot"
git config --global user.email "[email protected]"
git commit -a -m "Adding auto-generated artifacts for new models"
git push
2 changes: 1 addition & 1 deletion generate.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /bin/sh
#!/bin/bash
#######################################################################
# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
# Copyright (c) 2023 Contributors to the Eclipse Foundation
Expand Down