From 9544a7d0a84cb1b06fa041ca6cfeaa3ce2c49ac3 Mon Sep 17 00:00:00 2001 From: Stefano Moia Date: Fri, 22 Jan 2021 16:34:45 +0100 Subject: [PATCH 1/2] Add autorc and workflows for continous deployment --- .autorc | 92 ++++++++++++++++++++++++++++ .github/workflows/auto-release.yml | 43 +++++++++++++ .github/workflows/python-publish.yml | 32 ++++++++++ 3 files changed, 167 insertions(+) create mode 100644 .autorc create mode 100644 .github/workflows/auto-release.yml create mode 100644 .github/workflows/python-publish.yml diff --git a/.autorc b/.autorc new file mode 100644 index 0000000..d808012 --- /dev/null +++ b/.autorc @@ -0,0 +1,92 @@ +{ + "plugins": [ + "git-tag", + "conventional-commits", + "first-time-contributor", + "released" + ], + "owner": "physiopy", + "repo": "peakdet", + "name": "Stefano Moia", + "email": "s.moia@bcbl.eu", + "labels": [ + { + "name": "Majormod", + "changelogTitle": "💥 Breaking Change", + "description": "This PR breaks compatibility, and increments the major version (+1.0.0)", + "releaseType": "major", + "overwrite": true, + "color": "#05246d" + }, + { + "name": "Minormod", + "changelogTitle": "🚀 Enhancement", + "description": "This PR generally closes an `Enhancement` issue. It increments the minor version (0.+1.0)", + "releaseType": "minor", + "overwrite": true, + "color": "#05246d" + }, + { + "name": "Minormod-breaking", + "changelogTitle": "💥 Breaking Change during development", + "description": "For development only, this PR increments the minor version (0.+1.0) but breaks compatibility", + "releaseType": "minor", + "overwrite": true, + "color": "#05246d" + }, + { + "name": "BugFIX", + "changelogTitle": "🐛 Bug Fix", + "description": "This PR generally closes a `Bug` issue, and increments the patch version (0.0.+1)", + "releaseType": "patch", + "overwrite": true, + "color": "#d73a4a" + }, + { + "name": "Documentation", + "changelogTitle": "📝 Documentation", + "description": "This issue or PR is about the documentation ", + "releaseType": "none", + "overwrite": true, + "color": "#1D70CF" + }, + { + "name": "Testing", + "changelogTitle": "⚠️ Tests", + "description": "This is for testing features, writing tests or producing testing code", + "releaseType": "none", + "overwrite": true, + "color": "#ffb5b4" + }, + { + "name": "Internal", + "changelogTitle": "🏠 Internal", + "description": "Changes affect the internal API. It doesn't increase the version, but produces a changelog", + "releaseType": "none", + "overwrite": true, + "color": "#ffffff" + }, + { + "name": "Outreach", + "changelogTitle": "🖋️ Outreach", + "description": "Issue about outreaching of any form", + "releaseType": "none", + "overwrite": true, + "color": "#0e8a16" + }, + { + "name": "Skip release", + "description": "This PR preserves the current version when merged, and doesn't appear in the changelog", + "releaseType": "skip", + "overwrite": true, + "color": "#ffffff" + }, + { + "name": "Release", + "description": "For PR only, trigger a release at the merge", + "releaseType": "release", + "overwrite": true, + "color": "#FFFFFF" + } + ] +} \ No newline at end of file diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml new file mode 100644 index 0000000..d74f573 --- /dev/null +++ b/.github/workflows/auto-release.yml @@ -0,0 +1,43 @@ +# This workflows will create a release using auto when a PR is merged in master. + +name: Auto-release on PR merge + +on: + # ATM, this is the closest trigger to a PR merging + push: + branches: + - master + +jobs: + auto-release: + runs-on: ubuntu-18.04 + # Set skip ci to avoid loops + if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')" + # Set bash as default shell for jobs + defaults: + run: + shell: bash + steps: + - name: Checkout source + uses: actions/checkout@v2 + with: + # Fetch all history for all branches and tags + fetch-depth: 0 + # Use token with write access to the repo + token: ${{ secrets.GH_TOKEN }} + - name: Download and install latest auto + env: + # OS can be linux, macos, or win + OS: linux + # Retrieve URL of latest auto, download it, unzip it, and give exec permissions. + run: | + curl -vkL -o - $( curl -s https://api.github.com/repos/intuit/auto/releases/latest \ + | grep browser_download_url | grep ${OS} | awk -F'"' '{print $4}') \ + | gunzip > ~/auto + chmod a+x ~/auto + - name: Create release without version prefix + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + # Run auto release, don't use 'v' prefix, and be verbose + run: | + ~/auto shipit --no-version-prefix -v diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 0000000..6597645 --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -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@v2 + with: + python-version: '3.6' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build and publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/* From 7bca937837fcfc11d8327c9b4721238b9ba9c751 Mon Sep 17 00:00:00 2001 From: Stefano Moia Date: Fri, 22 Jan 2021 16:38:39 +0100 Subject: [PATCH 2/2] Add zenodo information --- .zenodo.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .zenodo.json diff --git a/.zenodo.json b/.zenodo.json new file mode 100644 index 0000000..b3243f5 --- /dev/null +++ b/.zenodo.json @@ -0,0 +1,21 @@ +{ + "license": "Apache-2.0", + "title": "physiopy/peakdet: A python toolbox for reproducible physiological data analysis", + "upload_type": "software", + "creators": [ + { + "affiliation": "McGill University", + "name": "Elizabeth DuPre" + }, + { + "affiliation": "McGill University", + "name": "Ross Markello" + }, + { + "orcid": "0000-0002-2553-3327", + "affiliation": "BCBL - Basque Center on Cognition, Brain and Language", + "name": "Stefano Moia" + } + ], + "access_right": "open" +}