3. Publish latest release to Zenodo #11
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: 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@v3 | |
with: | |
path: wikipathways-data-release | |
fetch-depth: 0 | |
ref: main | |
- name: Checkout pyzenodo4wpdata | |
uses: actions/checkout@v3 | |
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 |