-
Notifications
You must be signed in to change notification settings - Fork 2
97 lines (71 loc) · 2.91 KB
/
gt-repo-scripts.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
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: 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: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
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