Skip to content

Commit

Permalink
Merge pull request #657 from NLeSC/next_steps_workflow
Browse files Browse the repository at this point in the history
add next steps workflows to a single file
  • Loading branch information
fdiblen committed Sep 3, 2024
2 parents d16e357 + 6ad1486 commit 2e5371a
Show file tree
Hide file tree
Showing 7 changed files with 133 additions and 162 deletions.
13 changes: 2 additions & 11 deletions template/{% if AddCitation %}CITATION.cff{% endif %}.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,14 @@
cff-version: "1.2.0"
title: "{{ package_name }}"
authors:
-
family-names: {{ full_name.replace('\"', '\\\"').split(' ')[-1] }}
- family-names: {{ full_name.replace('\"', '\\\"').split(' ')[-1] }}
given-names: {{ full_name.replace('\"', '\\\"').split(' ')[0] }}
orcid: "https://orcid.org/0000-0000-0000-0000"
date-released: 20??-MM-DD
doi: <insert your DOI here>
date-released: {{ '%Y-%m-%d' | strftime }}
version: "{{ version }}"
repository-code: "{{ repository_url }}"
keywords:
{%- for item in keywords.split(',') %}
- "{{ item }}"
{%- endfor %}
message: "If you use this software, please cite it using these metadata."
{{ { "Apache Software License 2.0": "license: Apache-2.0",
"MIT license": "license: MIT",
"BSD license": "license: BSD-3-Clause",
"ISC license": "license: ISC",
"GNU General Public License v3 or later": "license: GPL-3.0-or-later",
"Not open source": ""
}[license] }}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
on: [push]
permissions:
contents: write
issues: write
name: Create GitHub issues
jobs:
next_steps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

{%- if AddCitation %}
- name: Create citation data issue
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: {{ '${{' }}secrets.GITHUB_TOKEN{{ '}}' }}
with:
filename: .github/workflows/next_steps_citation_issue.md
id: citation
- name: List created issues
run: |
echo "Created issues that must be completed to have fully working Python package:
* Citation data {{ '${{' }} steps.citation.outputs.url {{ '}}' }}"
- name: Cleanup files needed to create next steps issues
run: |
git config --global user.name 'NLeSC Python template'
git config --global user.email 'nlesc-python-template@users.noreply.github.com'
git pull # other next step workflows may push changes before
git rm .github/workflows/next_steps_citation_issue.md
git commit -am "Cleanup automated next steps issue generator for citation"
git push
{%- endif %}

{%- if AddLinting %}
- name: Create linting issue
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: {{ '${{' }}secrets.GITHUB_TOKEN{{ '}}' }}
with:
filename: .github/workflows/next_steps_linting_issue.md
id: linting
- name: List created issues
run: |
echo "Created issues that must be completed to have fully working Python package:
* Linting fixes {{ '${{' }} steps.linting.outputs.url {{ '}}' }}"
- name: Cleanup files needed to create next steps issues
run: |
git config --global user.name 'NLeSC Python template'
git config --global user.email 'nlesc-python-template@users.noreply.github.com'
git pull # other next step workflows may push changes before
git rm .github/workflows/next_steps_linting_issue.md
git commit -am "Cleanup automated next steps issue generator"
git push
{%- endif %}

{%- if AddOnlineDocumentation %}
- name: Create online documentation issue
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: {{ '${{' }}secrets.GITHUB_TOKEN{{ '}}' }}
with:
filename: .github/workflows/next_steps_online_documentation_issue.md
id: readthedocs
- name: List created issues
run: |
echo "Created issues that must be completed to have fully working Python package:
* Read the Docs instructions {{ '${{' }} steps.readthedocs.outputs.url {{ '}}' }}"
- name: Cleanup files needed to create next steps issues
run: |
git config --global user.name 'NLeSC Python template'
git config --global user.email 'nlesc-python-template@users.noreply.github.com'
git pull # other next step workflows may push changes before
git rm .github/workflows/next_steps_online_documentation_issue.md
git commit -am "Cleanup automated next steps issue generator for online documentation"
git push
{%- endif %}

{%- if AddZenodo %}
- name: Create Zenodo integration issue
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: {{ '${{' }}secrets.GITHUB_TOKEN{{ '}}' }}
with:
filename: .github/workflows/next_steps_zenodo_issue.md
id: zenodo
- name: List created issues
run: |
echo "Created issues that must be completed to have fully working Python package:
* Sonarcloud integration {{ '${{' }} steps.sonarcloud.outputs.url {{ '}}' }}"
- name: Cleanup files needed to create next steps issues
run: |
git config --global user.name 'NLeSC Python template'
git config --global user.email 'nlesc-python-template@users.noreply.github.com'
git pull # other next step workflows may push changes before
git rm .github/workflows/next_steps_zenodo_issue.md
git commit -am "Cleanup automated next steps issue generator for zenodo"
git push
{%- endif %}

{%- if AddSonarCloud %}
- name: Create Sonarcloud issue
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: {{ '${{' }}secrets.GITHUB_TOKEN{{ '}}' }}
with:
filename: .github/workflows/next_steps_sonarcloud_issue.md
id: sonarcloud
- name: List created issues
run: |
echo "Created issues that must be completed to have fully working Python package:
* Sonarcloud integration {{ '${{' }} steps.sonarcloud.outputs.url {{ '}}' }}"
- name: Cleanup files needed to create next steps issues
run: |
git config --global user.name 'NLeSC Python template'
git config --global user.email 'nlesc-python-template@users.noreply.github.com'
git pull # other next step workflows may push changes before
git rm .github/workflows/next_steps_sonarcloud_issue.md
git commit -am "Cleanup automated next steps issue generator for sonarcloud"
git push
{%- endif %}

{%- if AddCitation or AddLinting or AddOnlineDocumentation or AddZenodo or AddSonarCloud %}
- name: Cleanup files needed to create next steps issues
run: |
git config --global user.name 'NLeSC Python template'
git config --global user.email 'nlesc-python-template@users.noreply.github.com'
git pull # other next step workflows may push changes before
git rm .github/workflows/next_steps.yml
git commit -am "Cleanup automated next steps issue generator"
git push
{%- endif %}

0 comments on commit 2e5371a

Please sign in to comment.