-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (46 loc) · 1.55 KB
/
publish_latest_to_zenodo.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
name: 3. Publish latest release to Zenodo
on:
workflow_dispatch:
schedule:
- cron: "30 06 15 * *"
jobs:
publish-zenodo:
runs-on: ubuntu-latest
env:
ZENODO_TOKEN: ${{ secrets.ZENODO_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: wikipathways-data-release
fetch-depth: 0
ref: main
- name: Checkout pyzenodo4wpdata
uses: actions/checkout@v4
with:
repository: wikipathways/pyzenodo4wpdata
path: pyzenodo4wpdata
fetch-depth: 0
ref: main
- name: Publish to Zenodo
run: |
# Find latest 8-digit release number from dir names under wikipathways-data-release
RELEASE=$(ls -d wikipathways-data-release/* | grep -o '[0-9]\{8\}' | sort -n | tail -1)
echo "RELEASE set to $RELEASE"
# Copy files from pyzenodo4wpdata
cp pyzenodo4wpdata/pyzenodo4wpdata.py .
cp pyzenodo4wpdata/meta-template.json .
# Publish GMT to Zenodo
for f in wikipathways-data-release/$RELEASE/gmt/*.gmt; do
if [ -f "$f" ]; then
echo "$f"
python pyzenodo4wpdata.py ${ZENODO_TOKEN} meta-template.json $RELEASE $f
fi
done
# Publish GPML to Zenodo
for f in wikipathways-data-release/$RELEASE/gpml/*.zip; do
if [ -f "$f" ]; then
echo "$f"
python pyzenodo4wpdata.py ${ZENODO_TOKEN} meta-template.json $RELEASE $f
fi
done