You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* add the ability to make a new version on an existing doi
* add readme updates for specifying a doi
* add doi to the the action interface
* add debug log
* use conceptdoi
* one last readme update
* more docs about versions
* add alt text for png
* refactoring deploy.sh to be more organized, also tested to deploy different version
* zenodo json not hard requirement
Signed-off-by: vsoch <[email protected]>
Co-authored-by: Jeff Ohrstrom <[email protected]>
Co-authored-by: vsoch <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+81-7Lines changed: 81 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,10 +37,24 @@ I think this is kind of silly, but that's just me.
37
37
38
38
## Usage
39
39
40
+
When looking at artifacts in Zenodo you'll see a versions card like the image below. This artifact has
41
+
only one version, 0.0.15. By default, this is the behavior of this action - to create brand new artifacts
42
+
with only one version.
43
+
44
+
If, however, you'd like to make new versions you can specify the doi that represents *all*
45
+
versions. In this image you would specify `10.5281/zenodo.6326822`. This action will then
46
+
create new versions tied to this DOI.
47
+
48
+

49
+
40
50
### GitHub Action
41
51
42
-
After you complete the steps above to create the metadata file, you might create a release
43
-
action as follows:
52
+
After you complete the steps above to create the metadata file, you have two options.
53
+
54
+
#### Existing DOI
55
+
56
+
If you have an existing DOI that is of the **all versions** type meaning we can update it, you should provide it to the action.
57
+
The example below shows running a release workflow and providing an archive to update to a new version (**released under the same DOI**)
44
58
45
59
```yaml
46
60
name: Zenodo Release
@@ -68,13 +82,73 @@ jobs:
68
82
with:
69
83
token: ${{ secrets.ZENODO_TOKEN }}
70
84
version: ${{ github.event.release.tag_name }}
71
-
zenodo_json: .zenodo.json
85
+
zenodo_json: .zenodo.json# optional
72
86
archive: ${{ env.archive }}
87
+
88
+
# Optional DOI for all versions. Leaving this blank (the default) will create
89
+
# a new DOI on every release. Use a DOI that represents all versions will
90
+
# create a new version for this existing DOI.
91
+
#
92
+
# Newer versions have their own DOIs, but they're also linked to this DOI
93
+
# as a different version. When using this, use the DOI for all versions.
94
+
doi: '10.5281/zenodo.6326822'
73
95
```
74
96
75
-
Notice how we are choosing to use the .tar.gz (you could use the zip too at `${{ github.event.release.zipball_url }}`)
76
-
and using the default zenodo.json that is obtained from the checked out repository.
97
+
Notice how we are choosing to use the .tar.gz (you could use the zip too at `${{ github.event.release.zipball_url }}`).
98
+
Note that the "zenodo.json" is optional only if you've already created the record with some metadata. If you provide it,
99
+
it will be used to update metadata found with the previous upload. If you don't provide it, the previous upload will
100
+
only be updated for the date and version. Note that we are considering adding an ability to upload from new authors found
101
+
in the commit history, but this is not implemented yet.
102
+
103
+
#### New DOI
104
+
105
+
If you want to be creating fresh DOIs and releases (with no shared DOI for all versions) for each one, just remove the doi variable. Note
106
+
that for this case, the .zenodo.json is required as there isn't a previous record to get it from.
107
+
108
+
```yaml
109
+
name: Zenodo Release
110
+
111
+
on:
112
+
release:
113
+
types: [published]
114
+
115
+
jobs:
116
+
deploy:
117
+
runs-on: ubuntu-20.04
118
+
119
+
steps:
120
+
- uses: actions/checkout@v3
121
+
- name: download archive to runner
122
+
env:
123
+
tarball: ${{ github.event.release.tarball_url }}
124
+
run: |
125
+
name=$(basename ${tarball})
126
+
curl -L $tarball > $name
127
+
echo "archive=${name}" >> $GITHUB_ENV
128
+
129
+
- name: Run Zenodo Deploy
130
+
uses: rseng/zenodo-release@main
131
+
with:
132
+
token: ${{ secrets.ZENODO_TOKEN }}
133
+
version: ${{ github.event.release.tag_name }}
134
+
zenodo_json: .zenodo.json # required
135
+
archive: ${{ env.archive }}
136
+
```
137
+
138
+
#### Archives
139
+
140
+
For both of the above, instead of an exact archive path you can also use a pattern to give to Python's `glob.glob`. E.g.,:
141
+
142
+
```yaml
143
+
with:
144
+
archive: "files/*.tar.gz"
145
+
```
146
+
147
+
Note that we will be testing support for more than one path or pattern soon.
77
148
We also grab the version as the release tag. We are also running on the publication of a release.
149
+
150
+
#### Outputs
151
+
78
152
If you want to see or do something with the outputs, add an `id` to the deploy step and do:
0 commit comments