diff --git a/.github/workflows/htr-united.yml b/.github/workflows/htr-united.yml index 3cc062a..ee84d2a 100644 --- a/.github/workflows/htr-united.yml +++ b/.github/workflows/htr-united.yml @@ -1,59 +1,98 @@ -# This workflow will install Python dependencies, run tests and lint with a single version of Python -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - +# This file has been generated automatically with HTR-United <3 Github Actions form name: HTR United Workflow - -on: [push, pull_request] - +'on': + - push + - pull_request +permissions: + contents: write jobs: - HTRUC: # Tests that the catalog is correctly written + HTRUC: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.8 - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install htruc - - name: Run HTRUC - run: | - htruc test htr-united.yml + - uses: actions/checkout@v2 + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install htruc + - name: Run HTRUC + run: | + htruc test htr-united.yml HTR_United_Metadata_Generator: runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.8 - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install htr-united-metadata-generator htruc anybadge - - name: Run Report - run: | - humGenerator --parse page --group **/*.xml --github-envs --to-json updated_metrics.json --chars -n NFD - cat envs.txt >> $GITHUB_ENV - - name: Get HTR United Badge Template - if: github.ref == 'refs/heads/main' - uses: andymckay/get-gist-action@master - with: - gistURL: "https://gist.github.com/PonteIneptique/7813bb99f234b334fbf9c6c429ec2406" - - name: "Automatically update the catalog's volume key on master branch" - if: github.ref == 'refs/heads/main' - run: | - htruc update-volumes htr-united.yml updated_metrics.json --inplace - # Generate badges - mkdir -p badges - anybadge --value=${{ env.HTRUNITED_CHARS }} --file=badges/characters.svg --label=Characters --color=#007ec6 --overwrite --template=${{ steps.get.outputs.file }} - anybadge --value=${{ env.HTRUNITED_REGNS }} --file=badges/regions.svg --label=Regions --color=#007ec6 --overwrite --template=${{ steps.get.outputs.file }} - anybadge --value=${{ env.HTRUNITED_LINES }} --file=badges/lines.svg --label=Lines --color=#007ec6 --overwrite --template=${{ steps.get.outputs.file }} - anybadge --value=${{ env.HTRUNITED_FILES }} --file=badges/files.svg --label="XML Files" --color=#007ec6 --overwrite --template=${{ steps.get.outputs.file }} - git config user.name github-actions - git config user.email github-actions@github.com - git add htr-united.yml ./badges/ - git commit -m "[Automatic] Update of the Catalog & Badges" || echo "Nothing to commit" - git push || echo "Nothing to push" + - uses: actions/checkout@v2 + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install htr-united-metadata-generator htruc anybadge + - name: Run Report + run: | + humGenerator --chars -n NFD --parse page --group ./data/**/page/*.xml --github-envs --to-json updated_metrics.json + cat envs.txt >> $GITHUB_ENV + - name: Get HTR United Badge Template + if: github.ref == 'refs/heads/main' + uses: andymckay/get-gist-action@master + with: + gistURL: https://gist.github.com/PonteIneptique/7813bb99f234b334fbf9c6c429ec2406 + - name: Automatically update the Catalog & the Badges + if: github.ref == 'refs/heads/main' + run: |- + htruc update-volumes htr-united.yml updated_metrics.json --inplace + # Generate badges + mkdir -p badges + anybadge --value=${{ env.HTRUNITED_CHARS }} --file=badges/characters.svg --label=Characters --color=#007ec6 --overwrite --template=${{ steps.get.outputs.file }} + anybadge --value=${{ env.HTRUNITED_REGNS }} --file=badges/regions.svg --label=Regions --color=#007ec6 --overwrite --template=${{ steps.get.outputs.file }} + anybadge --value=${{ env.HTRUNITED_LINES }} --file=badges/lines.svg --label=Lines --color=#007ec6 --overwrite --template=${{ steps.get.outputs.file }} + anybadge --value=${{ env.HTRUNITED_FILES }} --file=badges/files.svg --label="XML Files" --color=#007ec6 --overwrite --template=${{ steps.get.outputs.file }} + git config user.name github-actions + git config user.email github-actions@github.com + git add htr-united.yml ./badges/ + git commit -m "[Automatic] Update the Catalog & the Badges" || echo "Nothing to commit" + git push || echo "Nothing to push" + - uses: rymndhng/release-on-push-action@master + if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }} + with: + bump_version_scheme: patch + use_github_release_notes: true + ChocoMufin: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install chocomufin + - name: Run ChocoMufin + run: | + chocomufin generate table.csv ./data/**/page/*.xml + cat table.csv + HTRVX: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install htrvx + - name: Run HTRVX + run: | + htrvx --verbose --group --format page --check-empty --segmonto --xsd ./data/**/page/*.xml + htrvx --verbose --group --format alto --check-empty --segmonto --xsd ./data/**/alto/*.xml \ No newline at end of file