Update gtrepo.yml #34
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: install CITATION.cff update | |
run: | | |
git clone https://github.com/tboenig/CITATIONupdate.git | |
- name: transform yml to json | |
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: update CITATION.cff | |
run: | | |
java -jar saxon-he-12.3.jar -xsl:CITATIONupdate/scripts/citationupdate.xsl \ | |
output=CITATION repoBase=$GITHUB_REF_Name repoName=$GITHUB_REPOSITORY bagitDumpNum=$GITHUB_RUN_NUMBER releaseTag=$GITHUB_REF_NAME \ | |
-s:CITATIONupdate/scripts/citationupdate.xsl -o:rawCITATION.cff | |
shell: bash | |
- name: formating CITATION.cff | |
uses: mikefarah/yq@master | |
with: | |
cmd: | | |
yq -I4 rawCITATION.cff > CITATION.cff | |
- name: Create Upload GitHub release | |
id: create-new-release | |
uses: ncipollo/release-action@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
allowUpdates: true | |
artifacts: 'gt-repo-scripts-package-v${{ github.run_number }}.zip' | |
artifactContentType: application/zip | |
tag: ${{ github.ref_name }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
name: gt-repo-scripts-package (Release${{ github.run_number }}) | |
omitNameDuringUpdate: true | |
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/> | |
<ul><li>If you wish to use the rules, this file must first be unpacked.</li> | |
<li>The archive file contains several XSLT files and shell scripts.</li> | |
<li>It is recommended to read the <a href="https://github.com/tboenig/gt-repo-scripts/blob/main/README.md">readme file</a> to understand the functionality and handling of the scripts.</li> | |
<li>The XSLT files and shell scripts are optimized for implementation within a GitHub action workflow.</li></ul> | |
</dd> | |
</dl> | |
</dl> | |
- 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 |