-
-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (102 loc) · 4.75 KB
/
accept.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Accept paper
on:
workflow_dispatch:
inputs:
repository_url:
description: 'URL of the repository containing the paper file'
required: true
branch:
description: 'Git branch where the paper Markdown file is'
required: false
issue_id:
description: 'The issue number of the submission'
required: true
add_labels:
description: 'Labels to add to the issue after successful run'
required: false
default: ''
jobs:
acceptance-and-publishing:
name: ${{ format('Accepting paper in issue {0}', github.event.inputs.issue_id) }}
runs-on: ubuntu-latest
env:
GH_ACCESS_TOKEN: ${{ secrets.BOT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
GH_REPO: neurolibre/neurolibre-reviews
ISSUE_ID: ${{ github.event.inputs.issue_id }}
DEFAULT_ERROR: ":warning: Couldn't acccept/publish paper. [An error happened](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}?check_suite_focus=true)."
steps:
- name: Compile Paper
id: generate-files
uses: neurolibre/paper-action@main
with:
repository_url: ${{ github.event.inputs.repository_url }}
branch: ${{ github.event.inputs.branch }}
issue_id: ${{ github.event.inputs.issue_id }}
journal: neurolibre
compile_mode: accepted
- name: Upload files to papers repo
id: upload-files
uses: neurolibre/upload-files-action@main
with:
papers_repo: neurolibre/preprints
branch_prefix: neurolibre
issue_id: ${{ github.event.inputs.issue_id }}
pdf_path: ${{ steps.generate-files.outputs.pdf_path}}
jats_path: ${{ steps.generate-files.outputs.jats_path}}
crossref_path: ${{ steps.generate-files.outputs.crossref_path}}
- name: Validate metadata files
id: validate-xml
uses: xuanxu/validate-xml-files-action@main
with:
jats_path: ${{ steps.generate-files.outputs.jats_path}}
crossref_path: ${{ steps.generate-files.outputs.crossref_path}}
validation_mode: strict
- name: Create and Merge Pull Request
id: pull-request
uses: neurolibre/deposit-pull-request-action@main
with:
papers_repo: neurolibre/preprints
papers_repo_main_branch: master
branch_prefix: neurolibre
issue_id: ${{ github.event.inputs.issue_id }}
bot_token: ${{ secrets.BOT_TOKEN }}
mode: deposit
- name: Deposit with Crossref
uses: neurolibre/deposit-with-crossref-action@main
with:
crossref_filepath: ${{ steps.generate-files.outputs.crossref_path}}
crossref_username: ${{ secrets.CROSSREF_USERNAME }}
crossref_password: ${{ secrets.CROSSREF_PASSWORD }}
- name: Deposit with NeuroLibre
id: neurolibre-deposit
uses: neurolibre/deposit-with-neurolibre-action@main
with:
journal_alias: neurolibre
journal_secret: ${{ secrets.JOURNAL_SECRET }}
issue_id: ${{ github.event.inputs.issue_id }}
paper_path: ${{ steps.generate-files.outputs.paper_file_path}}
- name: Citation.cff file info
uses: xuanxu/citation-file-action@main
with:
citation_file_path: ${{ steps.generate-files.outputs.citation_file_path}}
issue_id: ${{ github.event.inputs.issue_id }}
reviews_repo: neurolibre/neurolibre-reviews
gh_token: ${{ secrets.BOT_TOKEN }}
- name: Reply message
if: ${{ success() }}
run: |
gh issue comment ${{ github.event.inputs.issue_id }} --body "🌰🌱🌺 **THIS IS NOT A DRILL, YOU HAVE JUST PUBLISHED A NEUROLIBRE REPRODUCIBLE PREPRINT!** 🌺🌸🍀
Here's what you must now do:
0. Check final PDF and Crossref metadata that was deposited :point_right: ${{steps.pull-request.outputs.pr_url}}
1. Wait a couple of minutes, then verify that the paper DOI resolves [https://doi.org/${{steps.neurolibre-deposit.outputs.paper_doi}}](https://doi.org/${{steps.neurolibre-deposit.outputs.paper_doi}})
2. If everything looks good, then close this review issue.
3. Party like you just published more than a PDF! 🎉🌈🦄💃👻🤘
Any issues? Notify your editorial technical team..."
- name: Labeling
if: ${{ success() && github.event.inputs.add_labels != '' }}
run: gh issue edit ${{ github.event.inputs.issue_id }} --add-label ${{ github.event.inputs.add_labels }}
- name: Error message
if: ${{ failure() && env.CUSTOM_ERROR_STATUS != 'sent' }}
run: |
gh issue comment ${{ github.event.inputs.issue_id }} --body "${{ env.DEFAULT_ERROR }} ${{ env.CUSTOM_ERROR }}"