Skip to content

Commit

Permalink
Merge pull request #19 from Digital-HR/release/v0.2.0
Browse files Browse the repository at this point in the history
Release v0.2.0
  • Loading branch information
Johanan Idicula authored Feb 26, 2021
2 parents 89c20ea + 5b935f0 commit 2e12073
Show file tree
Hide file tree
Showing 12 changed files with 777 additions and 27 deletions.
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
<!-- A clear and concise description of what the bug is. -->

**To Reproduce**
<!-- Steps to reproduce the behavior: -->
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
<!-- A clear and concise description of what you expected to happen. -->

**Screenshots**
<!-- If applicable, add screenshots to help explain your problem. -->

**Environment (please complete the following information):**
- OS & Browser: [e.g. Windows, MacOSX, Linux] & [e.g. chrome, safari]
- Location : [e.g. DEV/TEST/PROD]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS & Browser: [e.g. iOS8.1] & [e.g. stock browser, safari]

**Additional context and Related Issues**
<!-- Add any other context about the problem here. -->
<!-- Add any related issues here. eg: Related to #399 -->
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Feature request
about: Suggest an idea for this project
title: 'Feature: '
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->

**Describe the solution you'd like**
<!-- A clear and concise description of what you want to happen. -->

**Describe alternatives you've considered**
<!-- A clear and concise description of any alternative solutions or features you've considered. -->

**Additional context and Related Issues**
<!-- Add any other context about the problem here. -->
<!-- Add any related issues here. eg: Related to #399 -->


**Sub-tickets**
<!-- Tickets for implementing individual parts of this feature -->
- [ ]
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/implementation-ticket.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Implementation ticket
about: [Devs only] A ticket describing implementation details of part of a Feature Request
title: 'Implementation: '
labels: ''
assignees: ''

---

**Parent Epic**
<!-- Add the feature-level epic that this ticket is (partially) implementing -->
#

**Implementation Details**
<!-- This must be filled prior to estimation. A short description of tasks a -->
<!-- developer might have to consider: e.g. "modify X model, change view, -->
<!-- modify scaffold".-->
- [ ]

**Related Tasks**
<!-- List related tasks here -->
-
4 changes: 4 additions & 0 deletions .github/RELEASE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Announcements
*

# Pull Requests
58 changes: 58 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: "Publish new release"

on:
pull_request:
branches:
- main
types:
- closed

jobs:
release:
name: Publish new release
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true # only merged pull requests must trigger this job
steps:
- name: Extract version from branch name (for release branches)
if: startsWith(github.event.pull_request.head.ref, 'release/')
run: |
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
VERSION=${BRANCH_NAME#release/}
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
- name: Extract version from branch name (for hotfix branches)
if: startsWith(github.event.pull_request.head.ref, 'hotfix/')
run: |
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
VERSION=${BRANCH_NAME#hotfix/}
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0 # Need to deep-clone all commits
- name: Merged Pull Requests
run: |
# Append all merge commits and authors since last tag until current
# commit into the release template under "Pull Requests". This change
# is NOT committed, and is only used for generating the release draft
# body later in this workflow job.
git log $(git describe HEAD --tags --abbrev=0)..HEAD --pretty='format:* %h %s%n * %an' --merges >> ".github/RELEASE_TEMPLATE.md"
- name: Commits
run: |
# Append all commit titles and authors since last tag until current
# commit into the release template. This change is NOT committed,
# and is only used for generating the release draft body in the next
# step of this workflow job.
echo -e "\n\n# Commits" >> ".github/RELEASE_TEMPLATE.md"
git log $(git describe HEAD --tags --abbrev=0)..HEAD --pretty='format:* %h %s%n * %an' --no-merges >> ".github/RELEASE_TEMPLATE.md"
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
# Names the release and tag after the version in pyproject.toml .
tag_name: ${{env.RELEASE_VERSION}}
release_name: ${{env.RELEASE_VERSION}}
body_path: '.github/RELEASE_TEMPLATE.md'
draft: true
prerelease: false
75 changes: 75 additions & 0 deletions .github/workflows/release-candidate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: "Create release candidate"

on:
workflow_dispatch:
inputs:
version:
description: 'The version you want to release.'
required: true

jobs:
create-release-candidate:
name: "Create release candidate"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.7'
# Perma-cache Poetry since we only need it for checking pyproject version
- name: Cache Poetry
id: cache-poetry
uses: actions/[email protected]
with:
path: ~/.poetry
key: poetry
# Only runs when key from caching step changes
- name: Install latest version of Poetry
if: steps.cache-poetry.outputs.cache-hit != 'true'
run: |
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
# Poetry still needs to be re-prepended to the PATH on each run, since
# PATH does not persist between runs.
- name: Add Poetry to $PATH
run: |
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
- name: Create release branch
run: git checkout -b release/v${{ github.event.inputs.version }}

# In order to make a commit, we need to initialize a user.
# You may choose to write something less generic here if you want, it doesn't matter functionality wise.
- name: Initialize mandatory git config
run: |
git config user.name "GitHub Actions"
git config user.email [email protected]
- name: Bump version in pyproject.toml
run: poetry version ${{ github.event.inputs.version }}

- name: Commit pyproject files
id: make-commit
run: |
git add pyproject.toml
git commit --message "chore: Release v${{ github.event.inputs.version }}"
echo "::set-output name=commit::$(git rev-parse HEAD)"
- name: Push new branch
run: git push origin release/v${{ github.event.inputs.version }}

- name: Create pull request
uses: thomaseizinger/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
head: release/v${{ github.event.inputs.version }}
base: main
title: Release v${{ github.event.inputs.version }}
reviewers: ${{ github.actor }} # By default, we request a review from the person who triggered the workflow.
# Write a nice message to the user.
# We are claiming things here based on the `publish-new-release.yml` workflow.
# You should obviously adopt it to say the truth depending on your release workflow :)
body: |
Hi @${{ github.actor }}!
This PR was created in response to a manual trigger of the release workflow here: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}.
I've updated bumped the versions in the manifest file in this commit: ${{ steps.make-commit.outputs.commit }}.
Merging this PR will create a GitHub release and upload any assets that are created as part of the release build.
138 changes: 138 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/
16 changes: 16 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-merge-conflict
- id: check-toml
- id: mixed-line-ending
- id: check-ast
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
- id: black
Loading

0 comments on commit 2e12073

Please sign in to comment.