Skip to content

Update gt-repo-scripts.yml #2

Update gt-repo-scripts.yml

Update gt-repo-scripts.yml #2

Workflow file for this run

name: gt-repo-scripts
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:
jobs:
cli:
name: gt-repo-scripts
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v4
# Installation and Directories
- name: Get SDK Version from config
id: lookupSdkVersion
uses: mikefarah/yq@master
with:
cmd: |
yq -o=json CITATION.cff > CITATION.json
- name: Download and install saxon
run: |
wget https://github.com/Saxonica/Saxon-HE/releases/download/SaxonHE12-3/SaxonHE12-3J.zip
unzip SaxonHE12-3J.zip
# Transformation and analysis
- name: generate CITATION.cff
run: |
java -jar saxon-he-12.3.jar -xsl:scripts/metadata.xsl \
output=CITATION repoBase=$GITHUB_REF_Name repoName=$GITHUB_REPOSITORY bagitDumpNum=$GITHUB_RUN_NUMBER releaseTag=$GITHUB_REF_NAME \
-s:scripts/metadata.xsl -o:rawCITATION.cff
shell: bash
- name: formating CITATION.cff
id: lookupSdkVersion2
uses: mikefarah/yq@master
with:
cmd: |
yq -I4 rawCITATION.cff > CITATION.cff
- name: Create GitHub release
id: create-new-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: gt-repo-scripts-package (Release${{ github.run_number }})
body: |
<dl>
<dt>Version:</dt>
<dd>gt-repo-scripts-package (Release${{ github.run_number }}_${{ github.ref_name }})</dd>
<dt>Info:</dt>
<dd>
The file gt-repo-scripts-package-v${{ github.run_number }}.zip is a zip archive file.<br/>
If you wish to use the rules, this file must first be unpacked.<br/><br/>
The archive file contains several XSLT files and shell scripts.<br/>
It is recommended to read the [readme file](https://github.com/tboenig/gt-repo-scripts/blob/main/README.md) to understand the functionality and handling of the scripts.<br/>
The XSLT files and shell scripts are optimized for implementation within a GitHub action workflow.
</dd>
</dl>
</dl>
draft: false
prerelease: false
- name: Upload asset to GitHub release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-new-release.outputs.upload_url }}
asset_path: ./gt-repo-scripts-package-v${{ github.run_number }}.zip
asset_name: gt-repo-scripts-package-v${{ github.run_number }}.zip
asset_content_type: application/zip
- name: Commit CITATION.cff
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add CITATION.cff
git commit -m "[Automatic] Update CITATION.cff files" || echo "Nothing to update"
git push origin HEAD:main