Skip to content

Commit

Permalink
integrate into Zenodo
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlancaster committed Nov 13, 2024
1 parent a94de89 commit f23ae95
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .github/actions/update_citations/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ inputs:
description: 'Path to the init file'
required: true
default: 'src/PyPop/__init__.py'
PUSH:
description: 'Behavior of push'
required: false
default: true

runs:
using: "composite"
Expand Down Expand Up @@ -38,10 +42,12 @@ runs:
for format in "${formats_array[@]}"; do
cffconvert --infile CITATION.cff --outfile "${{ inputs.CITATION_DIR }}/CITATION.${format}" --format "$format"
done
echo "pushing to ${{ inputs.PUSH }}"
shell: bash

- name: Commit and push changes
uses: EndBug/add-and-commit@v9
with:
message: "Auto-update citation files based on CITATION.cff"
add: "${{ inputs.CITATION_DIR }}/*"
push: "${{ inputs.PUSH }}"
9 changes: 7 additions & 2 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,14 @@ jobs:
git ls-files -z|git check-attr --stdin -z export-ignore |sed -zne 'x;n;n;s/^set$//;t print;b;:print;x;p'|xargs --null rm
# FIXME: need to also remove orphaned empty directories resulting from above
find . -empty -type d -delete
- name: Update generated citation files based on changed CITATION.cff file
uses: ./.github/actions/update_citations
with:
CITATION_DIR: 'src/PyPop/citation'
INIT_FILE: 'src/PyPop/__init__.py'
PUSH: "origin ${{ github.event.release.target_commitish }}"
- name: Create a draft snapshot of your repository contents as a new
version in test collection on Zenodo using metadata
from repository file .zenodo.json
version using metadata from generated .zenodo.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ZENODO_ACCESS_TOKEN: ${{ secrets.ZENODO_ACCESS_TOKEN }}
Expand Down

0 comments on commit f23ae95

Please sign in to comment.