-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (52 loc) · 1.74 KB
/
release-zenodo-deposit.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
name: Deposit on Zenodo
on:
workflow_call:
secrets:
# ZENODO_SANDBOX_ACCESS_TOKEN:
# required: true
ZENODO_ACCESS_TOKEN:
required: true
jobs:
zenodo_publish:
name: Publish on Zenodo
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: main
- name: Set up Python
uses: actions/setup-python@v4
with:
cache: 'pip'
cache-dependency-path: requirements.txt
python-version: '3.9'
- name: Install Python dependencies
run: pip install requests~=2.28.1
- name: Get current DOI
uses: mikefarah/[email protected]
with:
cmd: "echo CURRENT_DOI=$(yq '.doi' CITATION.cff) >> $GITHUB_ENV"
- name: Get collection id
id: collectionid
run: |
COLLECTION_ID=$(DOI=${{ env.CURRENT_DOI }} ZENODO_SANDBOX=false python ./.github/scripts/get_zenodo_collection.py)
echo "The collection id is ${COLLECTION_ID}"
echo "COLLECTION_ID=$COLLECTION_ID" >> $GITHUB_ENV
- name: Create a draft on Zenodo
# uses: zenodraft/[email protected]
uses: korvoj/zenodraft-action@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# ZENODO_SANDBOX_ACCESS_TOKEN: ${{ secrets.ZENODO_SANDBOX_ACCESS_TOKEN }}
ZENODO_ACCESS_TOKEN: ${{ secrets.ZENODO_ACCESS_TOKEN }}
with:
compression: zip
metadata: .zenodo.json
publish: false
upsert-doi: true
upsert-location: doi
sandbox: false
verbose: true
collection: ${{ env.COLLECTION_ID }} # Docs: https://github.com/marketplace/actions/zenodraft#collection