-
Notifications
You must be signed in to change notification settings - Fork 8
41 lines (34 loc) · 1.42 KB
/
citation.yaml
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
name: 'Check CITATION.cff for correct format'
on:
workflow_dispatch:
push:
tags:
- rust-*
jobs:
Validate-CITATION-cff:
runs-on: ubuntu-latest
name: Validate CITATION.cff
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Validate CITATION.cff
uses: dieghernan/cff-validator@v3
- name: Install Python dependencies
run: |
pip install cffconvert yq
- name: Verify CITATION.cff version field
run: |
CITATION_VERSION=$(cffconvert -f schema.org | jq -r .version)
LACE_VERSION=$(tomlq -r .package.version lace/Cargo.toml)
test "$CITATION_VERSION" = "$LACE_VERSION"
- name: Verify CITATION.cff date field
run: |
LAST_RELEASE=$(git describe --abbrev=0 --match="rust-*" HEAD~1)
echo $LAST_RELEASE
LAST_RELEASE_DATE=$(git cat-file -p $LAST_RELEASE:CITATION.cff | cffconvert -f schema.org | jq -r .datePublished)
CURRENT_RELEASE_DATE=$(cffconvert -f schema.org | jq -r .datePublished)
echo $CURRENT_RELEASE_DATE $LAST_RELEASE_DATE
# Verify that the release date was updated since the last release
[[ "$CURRENT_RELEASE_DATE" > "$LAST_RELEASE_DATE" ]]