-
Notifications
You must be signed in to change notification settings - Fork 4
/
action.yml
81 lines (77 loc) · 2.31 KB
/
action.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
name: "Zenodo Release Action"
description: "Release zenodo metadata so you don't have to give admin hook access"
inputs:
archive:
description: the path to the release archive
required: true
token:
description: zenodo token
required: true
version:
description: the release version
required: true
html_url:
description: The HTML url to appear with the release (optional)
zenodo_json:
description: Path to zenodo.json to upload with metadata (must exist)
doi:
descripton: The DOI to create a new version from
title:
description: zenodo title (optional)
description:
description: zenodo description (optional)
outputs:
badge:
description: badge url
value: ${{ steps.deploy.outputs.badge }}
bucket:
description: bucket url
value: ${{ steps.deploy.outputs.bucket }}
conceptbadge:
description: concept badge url
value: ${{ steps.deploy.outputs.conceptbadge }}
conceptdoi:
description: concept doi url
value: ${{ steps.deploy.outputs.conceptdoi }}
doi:
description: doi url
value: ${{ steps.deploy.outputs.doi }}
latest:
description: latest url
value: ${{ steps.deploy.outputs.latest }}
latest_html:
description: latest html url
value: ${{ steps.deploy.outputs.latest_html }}
record:
description: record url
value: ${{ steps.deploy.outputs.record }}
record_html:
description: record html url
value: ${{ steps.deploy.outputs.record_html }}
runs:
using: "composite"
steps:
- name: Deploy Zenodo
id: deploy
env:
zenodo_json: ${{ inputs.zenodo_json }}
archive: ${{ inputs.archive }}
version: ${{ inputs.version }}
html_url: ${{ inputs.html_url }}
ACTION_PATH: ${{ github.action_path }}
ZENODO_TOKEN: ${{ inputs.token }}
doi: ${{ inputs.doi }}
run: |
command="python ${{ github.action_path }}/scripts/deploy.py upload ${archive} --version ${version}"
if [[ "${doi}" != "" ]]; then
command="$command --doi ${doi}"
fi
if [[ "${zenodo_json}" != "" ]]; then
command="$command --zenodo-json ${zenodo_json}"
fi
if [[ "${html_url}" != "" ]]; then
command="$command --html-url ${html_url}"
fi
printf "$command\n"
$command
shell: bash