diff --git a/.github/workflows/gtrepo.yml b/.github/workflows/gtrepo.yml index e23cfd3..fcac24f 100644 --- a/.github/workflows/gtrepo.yml +++ b/.github/workflows/gtrepo.yml @@ -1,8 +1,11 @@ name: gtrepo -on: +on: push: - branches: - - main + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' + + + workflow_dispatch: @@ -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: | @@ -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 @@ -66,7 +73,7 @@ jobs: - # Transformation and analysis + # Transformation and analyzing - name: Get SDK Version from config id: lookupSdkVersion @@ -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 \ @@ -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 \ @@ -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: | @@ -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: | +