Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement automatic release #181

Merged
merged 26 commits into from
Jun 15, 2020
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
],
"imageSize": 100,
"commit": false,
"badgeTemplate": "[![All Contributors](https://img.shields.io/badge/all_contributors-<%= contributors.length %>-orange.svg?style=flat)](#contributors-)",
"contributors": [
{
"login": "danalclop",
Expand Down Expand Up @@ -135,7 +136,7 @@
]
}
],
"contributorsPerLine": 5,
"contributorsPerLine": 7,
"projectName": "phys2bids",
"projectOwner": "physiopy",
"repoType": "github",
Expand Down
68 changes: 68 additions & 0 deletions .autorc
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"plugins": [
"git-tag",
"all-contributors",
"conventional-commits",
"first-time-contributor",
"released"
],
"release": {
"prerelease": true
},
"prereleaseBranches": [
"master"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!
Wouldn't that unable us to automatically publish a release after every merged PR though?
From what I understand, that would trigger a new release only when the label release is added to the PR.
Our intentions are a bit different: we are an open development project, that wants to release as soon as there is something new, even if we're still in beta production stage.

The "prereleaseBranches" set on master is temporary, until we get out of beta stage.
Then we will remove it.

],
"owner": "physiopy",
"repo": "phys2bids",
"name": "Stefano Moia",
"email": "s.moia@bcbl.eu",
"labels": [
{
"name": "Majormod",
"changelogTitle": "💥 Breaking Change",
"description": "Increment the major version when merged",
"releaseType": "major",
"overwrite": true
},
{
"name": "Minormod",
"changelogTitle": "🚀 Enhancement",
"description": "Increment the minor version when merged",
"releaseType": "minor",
"overwrite": true
},
{
"name": "BugFIX",
"changelogTitle": "🐛 Bug Fix",
"description": "Increment the patch version when merged",
"releaseType": "patch",
"overwrite": true
},
{
"name": "Skip release",
"description": "Preserve the current version when merged",
"releaseType": "skip",
"overwrite": true
},
{
"name": "Release",
"description": "Create a release when this pr is merged",
"releaseType": "release",
"overwrite": true
},
{
"name": "Internal",
"changelogTitle": "🏠 Internal",
"description": "Changes only affect the internal API",
"releaseType": "none",
"overwrite": true
Copy link
Collaborator

@vinferrer vinferrer Mar 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why_ internal relases are not even a patch?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

internal is generally used for things like updating tests or anything project related that doesn't require a patch

},
{
"name": "Documentation",
"changelogTitle": "📝 Documentation",
"description": "Changes only affect the documentation",
"releaseType": "none",
"overwrite": true
}
]
}
32 changes: 32 additions & 0 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package

on:
release:
types: [created]

jobs:
deploy:

runs-on: ubuntu-18.04

steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.7
smoia marked this conversation as resolved.
Show resolved Hide resolved
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m python setup.py sdist bdist_wheel
python -m twine upload dist/*
41 changes: 37 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
language: python
sudo: false
dist: xenial
os: linux
dist: bionic
services:
- xvfb
notifications:
email: change

language: python

python:
- 3.6
- 3.7
Expand All @@ -28,9 +29,27 @@ matrix:
env:
- INSTALL_TYPE=wheel
- CHECK_TYPE=test
- language: node_js
node_js: 10
env:
- INSTALL_TYPE=auto-svl
- CHECK_TYPE=auto-svl
- GIT_NAME="Stefano Moia"
- GIT_EMAIL="s.moia@bcbl.eu"
- GH_USER="smoia"

before_install:
- python -m pip install --upgrade pip
- if [ "${CHECK_TYPE}" == "auto-svl" ]; then
CHECK_BRANCH=$( git branch | grep \*);
if [ "${CHECK_BRANCH}" == "* master" ]; then
git config --local user.name "${GIT_NAME}";
git config --local user.email "${GIT_EMAIL}";
else
echo "Not on master branch, skipping auto-svl";
fi;
else
python -m pip install --upgrade pip;
fi
- if [ "${CHECK_TYPE}" == "linting" ]; then
pip install flake8;
fi
Expand All @@ -50,6 +69,13 @@ install:
elif [ "${INSTALL_TYPE}" == "wheel" ]; then
python setup.py bdist_wheel;
pip install dist/*.whl;
elif [ "${INSTALL_TYPE}" == "auto-svl" ]; then
CHECK_BRANCH=$( git branch | grep \*);
if [ "${CHECK_BRANCH}" == "* master" ]; then
curl -vkL -o - https://github.com/intuit/auto/releases/download/v9.20.1/auto-linux.gz | gunzip > build/auto;
else
echo "Not on master branch, skipping auto-svl";
fi;
else
false;
fi
Expand All @@ -68,6 +94,13 @@ script:
cp ../setup.cfg ./;
args="--doctest-modules --cov-report term-missing --cov=phys2bids --pyargs"
python -m pytest ${args} phys2bids;
elif [ "${CHECK_TYPE}" == "auto-svl" ]; then
CHECK_BRANCH=$( git branch | grep \*);
if [ "${CHECK_BRANCH}" == "* master" ]; then
build/auto shipit;
else
echo "Not on master branch, skipping auto-svl";
fi;
else
false;
fi
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ phys2bids
=========

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3653153.svg)](https://doi.org/10.5281/zenodo.3653153)
[![Build Status](https://travis-ci.org/physiopy/phys2bids.svg?branch=master)](https://travis-ci.org/physiopy/phys2bids)
[![Join the chat at https://gitter.im/phys2bids/community](https://badges.gitter.im/phys2bids/community.svg)](https://gitter.im/phys2bids/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![codecov](https://codecov.io/gh/physiopy/phys2bids/branch/master/graph/badge.svg)](https://codecov.io/gh/physiopy/phys2bids)

[![Documentation Status](https://readthedocs.org/projects/phys2bids/badge/?version=latest)](https://phys2bids.readthedocs.io/en/latest/?badge=latest)
[![Build Status](https://travis-ci.org/physiopy/phys2bids.svg?branch=master)](https://travis-ci.org/physiopy/phys2bids)
[![Requirements Status](https://requires.io/github/physiopy/phys2bids/requirements.svg?branch=master)](https://requires.io/github/physiopy/phys2bids/requirements/?branch=master)
[![codecov](https://codecov.io/gh/physiopy/phys2bids/branch/master/graph/badge.svg)](https://codecov.io/gh/physiopy/phys2bids)
[![Auto Release](https://img.shields.io/badge/release-auto.svg?colorA=888888&colorB=9B065A&label=auto)](https://github.com/intuit/auto)
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-11-orange.svg?style=flat)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->
Expand Down
51 changes: 32 additions & 19 deletions docs/contributorfile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ Already know what you're looking for in this guide? Jump to the following sectio
- `Contributing code through GitHub <#code>`_
- `Issues and Milestones <#issuesmilestones>`_
- `Labels <#labeltypes>`_
- `Issues & PRs labels <#issueprlabels>`_
- `Issues labels <#issuelabel>`_
- `PRs labels <#prlabel>`_
- `Issues & PRs labels <#issueprlabels>`_
- `Good First Issues <#g1i>`_
- `Contribution workflow <#workflow>`_
- `Pull Requests <#pr>`_
Expand Down Expand Up @@ -116,12 +116,26 @@ At physiopy, we use Issues and Milestones to keep track of and organise our work
Labels
------
The current list of labels are `here <https://github.com/physiopy/phys2bids/labels>`_. They can be used for **Issues**, **PRs**, or both.
We use `auto <https://github.com/intuit/auto>`_ to automatise our semantic versioning and Pypi upload, so **it's extremely important to use the right PR labels**!

.. _issueprlabels:

Issues & PRs labels
smoia marked this conversation as resolved.
Show resolved Hide resolved
~~~~~~~~~~~~~~~~~~~
- Documentation: Improvements or additions to documentation. This category includes (but is not limited to) docs pages, docstrings, and code comments.
- Duplicate: Whatever this is, it exists already! Maybe it’s a closed Issue/PR, that should be reopened.
- Enhancement: New features added or requested. This normally goes with a ``minormod`` label for PRs.
- Outreach: As part of the scientific community, we care about outreach. Check the relevant section about it, but know that this Issue/PR contains information or tasks about abstracts, talks, demonstrations, papers.
- Paused: Issue or PR should not be worked on until the resolution of other issues or PRs.
- Testing: This is for testing features, writing tests or producing testing code. Both user testing and CI testing!
- Urgent: If you don't know where to start, start here! This is probably related to a milestone due soon!

.. _issuelabel:

Issues labels
~~~~~~~~~~~~~
Issues only labels
smoia marked this conversation as resolved.
Show resolved Hide resolved
~~~~~~~~~~~~~~~~~~
- Bug: Something isn’t working. It either breaks the code or has an unexpected outcome.
- Community: This issue contains information about the `physiopy` community (e.g. the next developer call)
- Discussion: Discussion of a concept or implementation. These Issues are prone to be open ad infinitum. Jump in the conversation if you want!
- Good first issue: Good for newcomers. These issues calls for a **fairly** easy enhancement, or for a change that helps/requires getting to know the code better. They have educational value, and for this reason, unless urgent, experts in the topic should refrain from closing them - but help newcomers closing them.
- Hacktoberfest: Dedicated to the hacktoberfest event, so that people can help and feel good about it (and show it with a T-shirt!). **Such commits will not be recognised in the all-contributor table, unless otherwise specified**.
Expand All @@ -132,24 +146,23 @@ Issues labels

.. _prlabel:

PRs labels
~~~~~~~~~~
- BugFIX: These PRs close an issue labelled ``bug``. they also increase the semantic versioning for fixes (+0.0.1).
- Invalid: These PRs don't seem right. They actually seem so not right that they won’t be further processed. This label invalidates an Hacktoberfest contribution. If you think this is wrong, start a discussion in the relevant issue (or open one if missing). Reviewers are asked to give an explanation for the use of this label.
PRs only labels
smoia marked this conversation as resolved.
Show resolved Hide resolved
~~~~~~~~~~~~~~~

smoia marked this conversation as resolved.
Show resolved Hide resolved
Labels for semantic release and changelogs
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- Majormod: These PRs call for a new major release (+1.0.0). This means that the PR is breaking backward compatibility.
- Minormod: These PRs call for a new minor release (0.+1.0). This means that the PR is **not** breaking backward compatibility.

.. _issueprlabels:

Issues & PRs labels
~~~~~~~~~~~~~~~~~~~
- Documentation: Improvements or additions to documentation. This category includes (but is not limited to) docs pages, docstrings, and code comments.
- Duplicate: Whatever this is, it exists already! Maybe it’s a closed Issue/PR, that should be reopened.
- Enhancement: New features added or requested. This normally goes with a ``minormod`` label for PRs.
- Outreach: As part of the scientific community, we care about outreach. Check the relevant section about it, but know that this Issue/PR contains information or tasks about abstracts, talks, demonstrations, papers.
- Paused: Issue or PR should not be worked on until the resolution of other issues or PRs.
- Testing: This is for testing features, writing tests or producing testing code. Both user testing and CI testing!
- Urgent: If you don't know where to start, start here! This is probably related to a milestone due soon!
- BugFIX: These PRs close an issue labelled ``bug``. They also increase the semantic versioning for fixes (+0.0.1).
- Internal: This PR contains changes to the internal API. It won't trigger a release, but it will be reported in the changelog.
- Documentation: See above. This PR won't trigger a release, but it will be reported in the changelog.
- Testing: See above. This PR won't trigger a release, but it will be reported in the changelog.
- Skip release: This PR will **not** trigger a release.
- Release: This PR will force the trigger of a release.

Other labels
^^^^^^^^^^^^
- Invalid: These PRs don't seem right. They actually seem so not right that they won’t be further processed. This label invalidates a Hacktoberfest contribution. If you think this is wrong, start a discussion in the relevant issue (or open one if missing). Reviewers are asked to give an explanation for the use of this label.

.. _g1i:

Expand Down
3 changes: 3 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ phys2bids
:target: https://codecov.io/gh/physiopy/phys2bids
:alt: codecov

.. image:: https://img.shields.io/badge/release-auto.svg?colorA=888888&colorB=9B065A&label=auto
:target: https://github.com/intuit/auto
:alt: Auto Release

``phys2bids`` is a python3 library meant to format physiological files in BIDS.
It was born for AcqKnowledge files (BIOPAC), and at the moment it supports
Expand Down
1 change: 0 additions & 1 deletion phys2bids/heuristics/heur_ex.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# import sys
# import fnmatch


Expand Down