Skip to content

Dump Baserow tables and create ARCHE turtle files #14

Dump Baserow tables and create ARCHE turtle files

Dump Baserow tables and create ARCHE turtle files #14

name: Dump Baserow tables and create ARCHE turtle files
on:
workflow_dispatch:
inputs:
database_id:
type: number
description: '(Required) Database ID as number'
required: true
default: 0
project_name:
type: string
description: '(Required) Project Name as string'
required: true
default: ''
resource_files_url:
type: string
description: '(Optional) Latest Release of Resource Files as URL'
required: false
default: ''
primary_data_directory:
type: string
description: '(Optional) Primary Data Directory Path as string'
required: false
default: ''
primary_file_format:
type: string
description: '(Optional) Primary File Format as string'
required: false
default: 'xml'
resource_files_url_2:
type: string
description: '(Optional) Latest Release of Additional Resource Files as URL'
required: false
default: ''
secondary_data_directory:
type: string
description: '(Optional) Secondary Data Directory Path as string'
required: false
default: ''
secondary_file_format:
type: string
description: '(Optional) Secondary File Format as string'
required: false
default: 'xml'
jobs:
update_baserow:
name: Dump Baserow tables and create ARCHE turtle files
runs-on: ubuntu-latest
env:
PRIMARY_FILE_FORMAT: ${{ github.event.inputs.primary_file_format }}
LATEST_RELEASE: ${{ github.event.inputs.resource_files_url }}
PRIMARY_DATA_DIRECTORY: ${{ github.event.inputs.primary_data_directory }}
ADDITIONAL_FILE_FORMAT: ${{ github.event.inputs.secondary_file_format }}
ADDITIONAL_RESOURCES: ${{ github.event.inputs.resource_files_url_2 }}
ADDITIONAL_DATA_DIRECTORY: ${{ github.event.inputs.secondary_data_directory }}
PROJECT_NAME: ${{ github.event.inputs.project_name }}
BASEROW_TOKEN: ${{ secrets.BASEROW_TOKEN }}
BASEROW_DB_ID: ${{ github.event.inputs.database_id }}
BASEROW_USER: ${{ secrets.BASEROW_USER }}
BASEROW_PW: ${{ secrets.BASEROW_PW }}
steps:
- name: Check out source repository
uses: actions/checkout@v3
- name: Set up Python environment
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Baserow Dump and TEI/XML Download
run: |
python scripts/baserow_dump.py
- name: Adding attributes to TEI root node
run: |
./shellscripts/add_attributes.sh
./shellscripts/denormalize.sh
- name: Run ant to add xml-model schema
run: |
apt-get update && apt-get install openjdk-11-jre-headless ant -y --no-install-recommend
./shellscripts/dl_saxon.sh
ant
- name: Creating ARCHE constants ttl file
run: |
python scripts/arche_constants.py
# - name: cache AV database
# id: avdb
# uses: actions/cache@v3
# with:
# path: ~/.cvdupdate
# key: constant
# - name: refresh AV database
# run: |
# python3 -m pip install --user cvdupdate && cvd update
# - name: Verify Binaries with repo-filechecker
# run: |
# ./shellscripts/filechecker.sh
# - name: Verify RDF Metadata with arche-metadata-crawler
# run: |
# composer require "acdh-oeaw/arche-metadata-crawler:^0.5.0"
# ./shellscripts/crawler.sh
- name: Commit data
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Downloaded/Updated Data