Skip to content

gt-repo-scripts

gt-repo-scripts #6

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/>
<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>
draft: false
prerelease: false
- 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