Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic PDF generation #7

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/pdf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Generate PDF

on:
release:
types: [published]
jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Combine recommendations into single file
run: ./convert.sh # create an example file
- name: Convert to PDF
uses: docker://pandoc/latex:2.9
with:
args: |
--output=recommendations.pdf recommendations.md
- uses: actions/setup-node@v1
with:
node-version: '12'
- name: Upload PDF to Zenodo
run: npx --package @iomeg/zenodo-upload zenodo_upload --sandbox 711602 recommendations.pdf "${github_ref:10}" ${{ secrets.ZENODO_TOKEN }}
env:
github_ref: ${{ github.ref }}
26 changes: 26 additions & 0 deletions convert.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Merge into a single file
cat README.md > recommendations.md
echo " " >> recommendations.md
cat repository.md >> recommendations.md
echo " " >> recommendations.md
cat license.md >> recommendations.md
echo " " >> recommendations.md
cat registry.md >> recommendations.md
echo " " >> recommendations.md
cat citation.md >> recommendations.md
echo " " >> recommendations.md
cat checklist.md >> recommendations.md
echo " " >> recommendations.md
cat fair.md >> recommendations.md

# Replace links to section headers
sed -i 's/checklist.md/#use-a-software-quality-checklist/' recommendations.md
sed -i 's/citation.md/#enable-citation-of-the-software/' recommendations.md
sed -i 's/license.md/#add-a-license/' recommendations.md
sed -i 's/registry.md/#register-your-code-in-a-community-registry/' recommendations.md
sed -i 's/repository.md/#use-a-publicly-accessible-repository-with-version-control/' recommendations.md
sed -i 's/fair.md/#what-is-fair/' recommendations.md
sed -i 's,LICENSE,https://github.com/fair-software/fair-software-recommendations/blob/master/LICENSE,' recommendations.md

# Convert to PDF
# pandoc recommendations.md -o recommendations.pdf