-
Notifications
You must be signed in to change notification settings - Fork 6
78 lines (70 loc) · 3.11 KB
/
zenodo.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
name: Zenodo Release
on: [push]
jobs:
deploy:
if: ${{ success() && contains(github.ref, 'refs/tags') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: "0"
- name: Generate Archive
# We don't use releases, but tags. Therefore, we have to make the zip ourselves.
# env:
# tarball: ${{ github.event.release.tarball_url }}
# zipball: ${{ github.event.release.zipball_url }}
# Add the suffix to the name of the file so type is recognized when
# downloading from Zenodo .tar.gz for tarball and .zip for zipball.
# Archiving the zipball will cause Zenodo to show a preview of the contents while using tarball will not.
run: |
make generate-archive
name=$(basename *.zip)
echo "ZENODO_ARCHIVE=${name}" >> $GITHUB_ENV
# if changelogs fail to generate, silently ignore
# prefer a partially generated release than none at all
- name: Generate Changelog
id: zenodo_metadata
env:
REPORTS_DIR: ${{ github.workspace }}/reports
CHANGES_HTML: ${{ github.workspace }}/reports/CHANGES_${{ github.ref_name }}.html
run: |
make generate-changes-html VERSION=${{ github.ref_name }} || true
echo "ZENODO_DESCRIPTION=$(cat ${{ env.CHANGES_HTML }} | tr -d '\n' || echo '')" >> $GITHUB_ENV
cat ${{ env.CHANGES_HTML }}
- name: Run Zenodo Publish
id: deploy_zenodo
uses: fmigneault/zenodo-release@main
with:
token: ${{ secrets.ZENODO_TOKEN }}
version: ${{ github.ref_name }}
zenodo_json: .zenodo.json
html_url: ${{ github.server_url }}/${{ github.repository }}/tree/${{ github.ref_name }} # GitHub tag link
archive: ${{ env.ZENODO_ARCHIVE }}
description: ${{ env.ZENODO_DESCRIPTION }}
# DOI for all versions. Leaving this blank (the default) will create
# a new DOI on every release. Use a DOI that represents all versions will
# create a new version for this existing DOI.
# Newer versions have their own DOIs, but they're also linked to this DOI
# as a different version. When using this, use the DOI for all versions.
doi: '10.5281/zenodo.14210717'
- name: View Outputs
env:
doi: ${{ steps.deploy_zenodo.outputs.doi }}
conceptdoi: ${{ steps.deploy_zenodo.outputs.conceptdoi }}
conceptbadge: ${{ steps.deploy_zenodo.outputs.conceptbadge }}
badge: ${{ steps.deploy_zenodo.outputs.badge }}
bucket: ${{ steps.deploy_zenodo.outputs.bucket }}
latest: ${{ steps.deploy_zenodo.outputs.latest }}
latest_html: ${{ steps.deploy_zenodo.outputs.latest_html }}
record: ${{ steps.deploy_zenodo.outputs.record }}
record_html: ${{ steps.deploy_zenodo.outputs.record_html }}
run: |
echo "doi ${doi}"
echo "conceptdoi ${conceptdoi}"
echo "conceptbadge ${conceptbadge}"
echo "badge ${badge}"
echo "bucket ${bucket}"
echo "latest ${latest}"
echo "latest html ${latest_html}"
echo "record ${record}"
echo "record html ${record_html}"