Skip to content

Commit

Permalink
Merge pull request #1 from d3b-center/repo_updates
Browse files Browse the repository at this point in the history
🔧 Repo setup
  • Loading branch information
chris-s-friedman authored Jan 17, 2023
2 parents 843ba32 + 8e682a7 commit 731bc24
Show file tree
Hide file tree
Showing 11 changed files with 337 additions and 413 deletions.
41 changes: 41 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: Bug report
description: Create a report to help us improve
title: "Bug Report: "
labels: bug
assignees: "chris-s-friedman"
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to report this bug!
- type: textarea
id: description
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is.
- type: textarea
id: reproduction
attributes:
label: To reproduce
description: Steps to reproduce
placeholder: |
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
- type: textarea
attributes:
label: Environment
description: |
examples:
- **OS**: Ubuntu 20.04
- **python**: 3.8
value: |
- OS:
- python:
render: markdown
validations:
required: True
---

38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Feature request
description: Suggest an idea for this project
title: "Feature Request: "
labels: enhancement
assignees: "chris-s-friedman"
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to suggest this feature!
- type: textarea
id: problem
attributes:
label: Is your feature request related to a problem? Please describe
description: |
A clear and concise description of what the problem is. Ex. I'm always
frustrated when [...]
- type: textarea
id: solution
attributes:
label: Describe the solution you'd like
description: A clear and concise description of what you want to happen.
- type: textarea
id: alternatives
attributes:
label: Describe alternatives you've considered
description: |
A clear and concise description of any alternative solutions or
features you've considered.
- type: textarea
id: context
attributes:
label: Additional Context
description: |
Add any other context or screenshots about the feature request here.
---

44 changes: 6 additions & 38 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,8 @@
<!--Pull Request Template-->
# Pull Request Name

## Description
- [ ] closes #xxxx
- [ ] README entry added if new functionality
- [ ] fixup commits are appropriately squashed
- [ ] submission_packet has been regenerated and committed as last commit in this PR

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

## How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

- [ ] Test A
- [ ] Test B

**Test Configuration**:
* Environment:
* Test files:

## Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules
- [ ] I have checked my code and corrected any misspellings
- [ ] I have committed any related changes to the PR
[Description here]
77 changes: 77 additions & 0 deletions .github/workflows/gh_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# This workflow will load Python, run a script to generate assets, and then
# bundle a github release

name: Release generator

on:
pull_request:
types:
- closed

jobs:
create_release:
if: github.event.pull_request.merged && contains( github.event.pull_request.labels.*.name, 'release')
runs-on: ubuntu-latest
steps:
- name: Manual workaround for Github not having a runtime macro to check for the default branch
id: gatekeeper
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
DEFAULT_BRANCH=$(curl -H "Authorization: token $GITHUB_TOKEN" -s https://api.github.com/repos/$GITHUB_REPOSITORY | jq -rc .default_branch)
unset IS_DEFAULT_BRANCH
if [ "$GITHUB_BASE_REF" == "$DEFAULT_BRANCH" ]; then IS_DEFAULT_BRANCH='true'; fi
echo "::set-output name=IS_DEFAULT_BRANCH::$IS_DEFAULT_BRANCH"
- uses: actions/checkout@v2
if: steps.gatekeeper.outputs.IS_DEFAULT_BRANCH

- uses: actions/setup-python@v2
if: steps.gatekeeper.outputs.IS_DEFAULT_BRANCH
with:
python-version: 3.8

- name: Create tag from title and run asset script
if: steps.gatekeeper.outputs.IS_DEFAULT_BRANCH
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
id: find_tag_and_prepare_assets
run: |
TAG=$(echo ${{ github.event.pull_request.title }} | sed -E "s/^.*Release (.+\..+\..+)$/\1/g")
echo "::set-output name=tag::$TAG"
SCRIPT=.github/prepare_assets.sh
if [ -f $SCRIPT ]; then
chmod u+x $SCRIPT
$SCRIPT $TAG
fi
- name: Create Release
if: steps.gatekeeper.outputs.IS_DEFAULT_BRANCH
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.find_tag_and_prepare_assets.outputs.tag }}
release_name: ${{ github.event.pull_request.title }}
body: ${{ github.event.pull_request.body }}
draft: false
prerelease: false

- name: Add latest-release tag
if: steps.gatekeeper.outputs.IS_DEFAULT_BRANCH
run: |
git tag -f latest-release
git push -f --tags
- name: Upload Assets
if: steps.gatekeeper.outputs.IS_DEFAULT_BRANCH
run: |
upload_url=${{ steps.create_release.outputs.upload_url }}
if [ -f .github/release_assets.txt ]; then
while IFS="" read -r FILE || [ -n "$FILE" ]
do
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: $(file -b --mime-type $FILE)" \
--data-binary "@$FILE" \
"${upload_url%\{*}?name=$(basename $FILE)"
done < .github/release_assets.txt
fi
31 changes: 31 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Lint Code Base
on:
pull_request:
branches: [main]
workflow_dispatch:

jobs:
build:
name: Lint New Commits
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.head_ref }}


- name: Lint Code Base
uses: github/super-linter@latest
env:
VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_BASH: false
VALIDATE_GITHUB_ACTIONS: false
PYTHON_BLACK_CONFIG_FILE: pyproject.toml
PYTHON_ISORT_CONFIG_FILE: pyproject.toml
MARKDOWN_CONFIG_FILE: .markdownlint.yml
LINTER_RULES_PATH: /
41 changes: 0 additions & 41 deletions .github/workflows/sync_pr_template.yml

This file was deleted.

Loading

0 comments on commit 731bc24

Please sign in to comment.