From 72a3183c6a7756b669a4be50e35ef2528fb9732d Mon Sep 17 00:00:00 2001 From: Carlos Martinez Date: Sat, 26 Dec 2020 12:02:37 +0100 Subject: [PATCH 1/4] Github action for uploading PDF --- .github/workflows/pdf.yml | 24 ++++++++++++++++++++++++ convert.sh | 26 ++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 .github/workflows/pdf.yml create mode 100755 convert.sh diff --git a/.github/workflows/pdf.yml b/.github/workflows/pdf.yml new file mode 100644 index 0000000..7e75042 --- /dev/null +++ b/.github/workflows/pdf.yml @@ -0,0 +1,24 @@ +name: Generate PDF + +on: push + +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/core: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 "version_test01" ${{ secrets.ZENODO_TOKEN }} + env: + github_ref: ${{ github.ref }} \ No newline at end of file diff --git a/convert.sh b/convert.sh new file mode 100755 index 0000000..ad33755 --- /dev/null +++ b/convert.sh @@ -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 From 26501ba293767474fb9f912d1f4940b71a8e91b9 Mon Sep 17 00:00:00 2001 From: Carlos Martinez Date: Sat, 26 Dec 2020 12:20:16 +0100 Subject: [PATCH 2/4] command as single line --- .github/workflows/pdf.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pdf.yml b/.github/workflows/pdf.yml index 7e75042..344edb7 100644 --- a/.github/workflows/pdf.yml +++ b/.github/workflows/pdf.yml @@ -13,8 +13,7 @@ jobs: uses: docker://pandoc/core:2.9 with: args: | - --output=recommendations.pdf - recommendations.md + --output=recommendations.pdf recommendations.md - uses: actions/setup-node@v1 with: node-version: '12' From 44ce7976db2775e8228841b57620417008bea308 Mon Sep 17 00:00:00 2001 From: Carlos Martinez Date: Sat, 26 Dec 2020 12:23:16 +0100 Subject: [PATCH 3/4] Use latex engine --- .github/workflows/pdf.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pdf.yml b/.github/workflows/pdf.yml index 344edb7..5b4cce3 100644 --- a/.github/workflows/pdf.yml +++ b/.github/workflows/pdf.yml @@ -10,7 +10,7 @@ jobs: - name: Combine recommendations into single file run: ./convert.sh # create an example file - name: Convert to PDF - uses: docker://pandoc/core:2.9 + uses: docker://pandoc/latex:2.9 with: args: | --output=recommendations.pdf recommendations.md From 5375f46d8a6f7664e91d35431171c7452ed268c9 Mon Sep 17 00:00:00 2001 From: Carlos Martinez Date: Sat, 26 Dec 2020 12:26:11 +0100 Subject: [PATCH 4/4] Publish on release --- .github/workflows/pdf.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pdf.yml b/.github/workflows/pdf.yml index 5b4cce3..771b3a0 100644 --- a/.github/workflows/pdf.yml +++ b/.github/workflows/pdf.yml @@ -1,7 +1,8 @@ name: Generate PDF -on: push - +on: + release: + types: [published] jobs: generate: runs-on: ubuntu-latest @@ -18,6 +19,6 @@ jobs: with: node-version: '12' - name: Upload PDF to Zenodo - run: npx --package @iomeg/zenodo-upload zenodo_upload --sandbox 711602 recommendations.pdf "version_test01" ${{ secrets.ZENODO_TOKEN }} + run: npx --package @iomeg/zenodo-upload zenodo_upload --sandbox 711602 recommendations.pdf "${github_ref:10}" ${{ secrets.ZENODO_TOKEN }} env: github_ref: ${{ github.ref }} \ No newline at end of file