Skip to content

Commit de1b5b0

Browse files
Add workflow to release to Figshare on release
1 parent 282a225 commit de1b5b0

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/figshare.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Release to Figshare
2+
on:
3+
workflow_dispatch:
4+
release:
5+
types: [published]
6+
jobs:
7+
upload:
8+
runs-on: ubuntu-latest
9+
env:
10+
ARCHIVE_NAME: ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}
11+
steps:
12+
- name: prepare-data-folder
13+
run : mkdir 'data'
14+
- name: download-archive
15+
run: |
16+
curl -sL "${{ github.event.release.zipball_url }}" > "$ARCHIVE_NAME".zip
17+
curl -sL "${{ github.event.release.tarball_url }}" > "$ARCHIVE_NAME".tar.gz
18+
- name: move-archive
19+
run: |
20+
mv "$ARCHIVE_NAME".zip data/
21+
mv "$ARCHIVE_NAME".tar.gz data/
22+
- name: upload-to-figshare
23+
uses: figshare/[email protected]
24+
with:
25+
FIGSHARE_TOKEN: ${{ secrets.FIGSHARE_TOKEN }}
26+
FIGSHARE_ENDPOINT: 'https://api.figshare.com/v2'
27+
FIGSHARE_ARTICLE_ID: <<24427516>>
28+
DATA_DIR: 'data'

0 commit comments

Comments
 (0)