Skip to content

Commit

Permalink
Update gtrepo.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
tboenig authored Apr 15, 2024
1 parent 327db65 commit fc3cbb6
Showing 1 changed file with 55 additions and 21 deletions.
76 changes: 55 additions & 21 deletions .github/workflows/gtrepo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ on:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'



workflow_dispatch:



inputs:
tag-name:
description: Name of the release tag

jobs:
job1:
name: uniTest
Expand All @@ -22,7 +21,7 @@ jobs:
output1: ${{ steps.step4.outputs.test }}
output2: ${{ steps.step4.outputs.test2 }}

steps:
steps:
- name: Git checkout
id: step1
uses: actions/checkout@v4
Expand Down Expand Up @@ -53,7 +52,13 @@ jobs:
id: lookupSdkVersion
uses: mikefarah/yq@master
with:
cmd: yq -o=json METADATA.yml > METADATA.json
cmd: |
yq -o=json METADATA.yml > METADATA.json


- name: PathTest
run: |
Expand Down Expand Up @@ -90,6 +95,13 @@ jobs:


steps:
- name: Using tag name from ref name
if: github.event.inputs.tag-name == ''
run: echo "TAG_NAME=$GITHUB_REF_NAME" >> $GITHUB_ENV

- name: Using tag name from input param
if: github.event.inputs.tag-name != ''
run: echo "TAG_NAME=${{ github.event.inputs.tag-name}}" >> $GITHUB_ENV

- name: Git checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -145,26 +157,28 @@ jobs:
id: lookupSdkVersion
uses: mikefarah/yq@master
with:
cmd: yq -o=json METADATA.yml > METADATA.json
cmd: |
yq -o=json METADATA.yml > METADATA.json
- name: transform METADATA and make GT-Overview
run: |
java -jar saxon-he-12.3.jar -xsl:scripts/gt-overview_metadata.xsl \
output=METADATA repoBase=$GITHUB_REF_NAME repoName=$GITHUB_REPOSITORY bagitDumpNum=$GITHUB_RUN_NUMBER releaseTag=$GITHUB_REF_NAME \
output=METADATA repoBase=${{ env.TAG_NAME }} repoName=$GITHUB_REPOSITORY bagitDumpNum=$GITHUB_RUN_NUMBER releaseTag=${{ env.TAG_NAME }} \
-s:scripts/gt-overview_metadata.xsl -o:ghout/metadata.md
shell: bash

- name: make Compressed table view
run: |
java -jar saxon-he-12.3.jar -xsl:scripts/gt-overview_metadata.xsl \
output=TABLE repoBase=$GITHUB_REF_NAME repoName=$GITHUB_REPOSITORY \
output=TABLE repoBase=${{ env.TAG_NAME }} repoName=$GITHUB_REPOSITORY \
-s:scripts/gt-overview_metadata.xsl -o:ghout/table.md
shell: bash

- name: detailed table view
run: |
java -jar saxon-he-12.3.jar -xsl:scripts/gt-overview_metadata.xsl \
output=OVERVIEW repoBase=$GITHUB_REF_Name repoName=$GITHUB_REPOSITORY \
output=OVERVIEW repoBase=${{ env.TAG_NAME }} repoName=$GITHUB_REPOSITORY \
-s:scripts/gt-overview_metadata.xsl -o:ghout/overview.md
shell: bash

Expand All @@ -178,14 +192,14 @@ jobs:
- name: generate mets.sh
run: |
java -jar saxon-he-12.3.jar -xsl:scripts/gt-overview_metadata.xsl \
output=METS repoBase=$GITHUB_REF_Name repoName=$GITHUB_REPOSITORY \
output=METS repoBase=${{ env.TAG_NAME }} repoName=$GITHUB_REPOSITORY \
-s:scripts/gt-overview_metadata.xsl -o:scripts/mets.sh
shell: bash

- name: generate Metadata JSON file
run: |
java -jar saxon-he-12.3.jar -xsl:scripts/gt-overview_metadata.xsl \
output=METAJSON repoBase=$GITHUB_REF_Name repoName=$GITHUB_REPOSITORY bagitDumpNum=$GITHUB_RUN_NUMBER releaseTag=$GITHUB_REF_NAME \
output=METAJSON repoBase=${{ env.TAG_NAME }} repoName=$GITHUB_REPOSITORY bagitDumpNum=$GITHUB_RUN_NUMBER releaseTag=${{ env.TAG_NAME }} \
-s:scripts/gt-overview_metadata.xsl -o:metadata_out/metadata_l.json
shell: bash

Expand All @@ -200,35 +214,42 @@ jobs:
- name: generate README
run: |
java -jar saxon-he-12.3.jar -xsl:scripts/gt-overview_metadata.xsl \
output=README repoBase=$GITHUB_REF_Name repoName=$GITHUB_REPOSITORY \
output=README repoBase=${{ env.TAG_NAME }} repoName=$GITHUB_REPOSITORY \
-s:scripts/gt-overview_metadata.xsl -o:README.md
shell: bash


- name: generate METADATA_htr_united.yml
run: |
java -jar saxon-he-12.3.jar -xsl:scripts/gt-metadata_htr_united.xsl repoName=${{ github.event.repository.name }} \
-s:scripts/gt-metadata_htr_united.xsl
shell: bash

- name: generate METS Volume File
run: |
java -jar saxon-he-12.3.jar -xsl:scripts/gt-overview_metadata.xsl \
output=METSvolume repoBase=$GITHUB_REF_Name repoName=$GITHUB_REPOSITORY bagitDumpNum=$GITHUB_RUN_NUMBER releaseTag=$GITHUB_REF_NAME \
output=METSvolume repoBase=${{ env.TAG_NAME }} repoName=$GITHUB_REPOSITORY bagitDumpNum=$GITHUB_RUN_NUMBER releaseTag=${{ env.TAG_NAME }} \
-s:scripts/gt-overview_metadata.xsl -o:metadata_out/mets.xml
shell: bash

- name: generate release download List
run: |
java -jar saxon-he-12.3.jar -xsl:scripts/gt-overview_metadata.xsl \
output=download repoBase=$GITHUB_REF_Name repoName=$GITHUB_REPOSITORY bagitDumpNum=$GITHUB_RUN_NUMBER releaseTag=$GITHUB_REF_NAME \
output=download repoBase=${{ env.TAG_NAME }} repoName=$GITHUB_REPOSITORY bagitDumpNum=$GITHUB_RUN_NUMBER releaseTag=${{ env.TAG_NAME }} \
-s:scripts/gt-overview_metadata.xsl -o:ghout/download.txt
shell: bash

- name: delete fileGrp DEFAULT
run: |
java -jar saxon-he-12.3.jar -xsl:scripts/gt-overview_metadata.xsl \
output=METSdefault repoBase=$GITHUB_REF_Name repoName=$GITHUB_REPOSITORY bagitDumpNum=$GITHUB_RUN_NUMBER releaseTag=$GITHUB_REF_NAME \
output=METSdefault repoBase=${{ env.TAG_NAME }} repoName=$GITHUB_REPOSITORY bagitDumpNum=$GITHUB_RUN_NUMBER releaseTag=${{ env.TAG_NAME }} \
-s:scripts/gt-overview_metadata.xsl
shell: bash

- name: generate CITATION.cff
run: |
java -jar saxon-he-12.3.jar -xsl:scripts/gt-overview_metadata.xsl \
output=CITATION repoBase=$GITHUB_REF_Name repoName=$GITHUB_REPOSITORY bagitDumpNum=$GITHUB_RUN_NUMBER releaseTag=$GITHUB_REF_NAME \
output=CITATION repoBase=${{ env.TAG_NAME }} repoName=$GITHUB_REPOSITORY bagitDumpNum=$GITHUB_RUN_NUMBER releaseTag=${{ env.TAG_NAME }} \
-s:scripts/gt-overview_metadata.xsl -o:rawCITATION.cff
shell: bash

Expand Down Expand Up @@ -297,14 +318,15 @@ jobs:
- name: Upload Release
uses: ncipollo/release-action@v1
if: env.TAG_NAME != ''
with:
allowUpdates: true
artifacts: 'ocrdzip_out/*.zip'
artifactContentType: application/zip
name: Release ${{ github.run_number }}_${{ github.ref_name }}
body: |
<dl>
<dt>Version:</dt>
<dd>${{ github.ref_name }}</dd>
<dd>${{ env.TAG_NAME }}</dd>
<dt>Info:</dt>
<dd>
To make use of Ground Truth, please download the provided zip files.<br/>
Expand All @@ -317,6 +339,9 @@ jobs:
</dd>
</dl>
</dl>
name: Release ${{ github.run_number }}_${{ env.TAG_NAME }}
omitNameDuringUpdate: true
tag: ${{ env.TAG_NAME }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Commit README
Expand All @@ -327,6 +352,15 @@ jobs:
git commit -m "[Automatic] Update readme files" || echo "Nothing to update"
git push origin HEAD:main
- name: Commit METADATA_htr_united.yml
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add ${{ github.event.repository.name }}_METADATA_htr_united.yml
git commit -m "[Automatic] Update METADATA_htr_united.yml files" || echo "Nothing to update"
git push origin HEAD:main
- name: Commit CITATION.cff
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
Expand All @@ -337,7 +371,7 @@ jobs:

- name: Deploy GT-Overview to GitHub Pages 🚀
uses: JamesIves/github-pages-deploy-action@v4.4.1
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages # The branch the action should deploy to.
folder: ghout # The folder the action should deploy.

0 comments on commit fc3cbb6

Please sign in to comment.