Skip to content

Commit

Permalink
update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
tboenig committed Mar 23, 2023
1 parent c705254 commit 9a4b472
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 37 deletions.
90 changes: 54 additions & 36 deletions .github/workflows/gtrepo.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: gtrepo
on:
on:
push:
branches:
- main
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'



workflow_dispatch:


Expand All @@ -18,17 +21,17 @@ jobs:
steps:

- name: Git checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

# Installation Styles
# Installation Styles

- name: install anaylse xsl-styles
- name: install analyse xsl-styles
run: |
git clone https://github.com/tboenig/gt-repo-scripts.git
mv gt-repo-scripts/scripts scripts/
rm -r gt-repo-scripts
# Installation GT-Labelling Documentation
# Installation GT-Labelling Documentation

- name: install labeling
run: |
Expand All @@ -37,10 +40,14 @@ jobs:
# Installation and Directories

- name: install jq
run: sudo apt-get install jq

- name: install ocrd
run: |
git clone --depth 1 https://github.com/OCR-D/core
cd core
sudo make deps-ubuntu
make install
cd ..
rm -rf core
Expand All @@ -66,7 +73,7 @@ jobs:



# Transformation and analysis
# Transformation and analyzing

- name: Get SDK Version from config
id: lookupSdkVersion
Expand All @@ -88,7 +95,7 @@ jobs:
-s:scripts/gt-overview_metadata.xsl -o:ghout/table.md
shell: bash

- name: detailed table view
- name: detailed table view
run: |
java -jar saxon-he-10.5.jar -xsl:scripts/gt-overview_metadata.xsl \
output=OVERVIEW repoBase=$GITHUB_REF_Name repoName=$GITHUB_REPOSITORY \
Expand All @@ -102,6 +109,21 @@ jobs:
-s:scripts/gt-overview_metadata.xsl -o:scripts/mets.sh
shell: bash

- name: generate Metadata JSON file
run: |
java -jar saxon-he-10.5.jar -xsl:scripts/gt-overview_metadata.xsl \
output=METAJSON repoBase=$GITHUB_REF_Name repoName=$GITHUB_REPOSITORY bagitDumpNum=$GITHUB_RUN_NUMBER \
-s:scripts/gt-overview_metadata.xsl -o:ocrdzip_out/metadata_l.json
shell: bash


- name: format json file and copy to gh branch
run: |
jq '.' ocrdzip_out/metadata_l.json > ocrdzip_out/metadata.json
cp ocrdzip_out/metadata.json ghout/
rm ocrdzip_out/metadata_l.json
- name: generate README
run: |
java -jar saxon-he-10.5.jar -xsl:scripts/gt-overview_metadata.xsl \
Expand All @@ -118,10 +140,10 @@ jobs:

- name: delete fileGrp DEFAULT
run: |
sudo java -jar saxon-he-10.5.jar -xsl:scripts/gt-overview_metadata.xsl \
java -jar saxon-he-10.5.jar -xsl:scripts/gt-overview_metadata.xsl \
output=METSdefault repoBase=$GITHUB_REF_Name repoName=$GITHUB_REPOSITORY bagitDumpNum=$GITHUB_RUN_NUMBER \
-s:scripts/gt-overview_metadata.xsl
shell: bash
shell: bash

- name: Index-link
run: |
Expand All @@ -145,32 +167,28 @@ jobs:
- name: archive the ocrdzip files from ocrdzip_out folder
uses: thedoctor0/zip-release@master
with:
filename: site.zip
filename: bagitDump-v${{ github.run_number }}.zip
path: 'ocrdzip_out'


- name: Create GitHub release
id: create-new-release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.run_number }}
release_name: Release ${{ github.run_number }}
body_path: CHANGELOG.md
draft: false
prerelease: false


- name: Upload asset to GitHub release
uses: actions/upload-release-asset@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload Release
uses: ncipollo/release-action@v1
with:
upload_url: ${{ steps.create-new-release.outputs.upload_url }}
asset_path: ./site.zip
asset_name: bagitDump-v${{ github.run_number }}.zip
asset_content_type: application/zip
artifacts: './bagitDump-v*.zip'
artifactContentType: application/zip
name: Release ${{ github.run_number }}_${{ github.ref_name }}
body: |
<dl>
<dt>Version:</dt>
<dd>${{ github.ref_name }}</dd>
<dt>Info:</dt>
<dd>To use the Ground Truth download the bagitDump-v${{ github.run_number }}.zip file.<br/>
The zip file contains all ocr-d-bagit files.<br/>
The Metadata.json file contains metadata for the Ground Truth corpus.<br/>
The Mets.xml file lists all containing documents/bagits.<br/>
The bagits correspond to the <a href="https://ocr-d.de/de/spec/ocrd_zip.html">OCR-D Bagit Spec</a>.</dd>
</dl>
token: ${{ secrets.GITHUB_TOKEN }}

- name: Commit README
run: |
Expand All @@ -182,7 +200,7 @@ jobs:
- name: Deploy GT-Overview to GitHub Pages 🚀
uses: JamesIves/github-pages-deploy-action@v4.3.3
uses: JamesIves/github-pages-deploy-action@v4.4.1
with:
branch: gh-pages # The branch the action should deploy to.
folder: ghout # The folder the action should deploy.
folder: ghout # The folder the action should deploy.
1 change: 0 additions & 1 deletion CHANGELOG.md

This file was deleted.

0 comments on commit 9a4b472

Please sign in to comment.