Skip to content

Commit

Permalink
Split CI workflow into 3 as requested
Browse files Browse the repository at this point in the history
  • Loading branch information
browniebroke committed Nov 8, 2020
1 parent 1ef2bfe commit c1b0b3b
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 40 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/deploy.yml
@@ -0,0 +1,51 @@
name: Deploy

on:
push:
branches:
- master
release:
types:
- published

jobs:
deploy:
if: github.repository == 'jazzband/django-redshift-backend'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: deploy-${{ hashFiles('**/setup.py') }}
restore-keys: |
deploy-
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U setuptools twine wheel
- name: Build package
run: |
python setup.py --version
python setup.py sdist --format=gztar bdist_wheel
twine check dist/*
- name: Publish package to Jazzband
if: github.event.action == 'published'
uses: pypa/gh-action-pypi-publish@master

with:
user: jazzband
password: ${{ secrets.JAZZBAND_RELEASE_KEY }}
repository_url: https://jazzband.co/projects/django-redshift-backend/upload
25 changes: 25 additions & 0 deletions .github/workflows/lint.yml
@@ -0,0 +1,25 @@
name: Lint

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
linter:
- flake8
- readme

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U tox
- run: tox -e ${{ matrix.linter }}
32 changes: 1 addition & 31 deletions .github/workflows/ci.yml → .github/workflows/test.yml
@@ -1,4 +1,4 @@
name: CI
name: Test

on: [push, pull_request]

Expand Down Expand Up @@ -52,33 +52,3 @@ jobs:
run: tox
env:
DJANGO: ${{ matrix.django }}

deploy:
runs-on: ubuntu-latest
needs:
- tests

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.6

- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U setuptools twine wheel
- name: Build packages
run: |
python setup.py --version
python setup.py sdist --format=gztar bdist_wheel
twine check dist/*
- name: Publish packages to Jazzband
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: jazzband
password: ${{ secrets.JAZZBAND_RELEASE_KEY }}
repository_url: https://jazzband.co/projects/prettytable/upload
6 changes: 3 additions & 3 deletions README.rst
Expand Up @@ -26,9 +26,9 @@ This is a `Amazon Redshift`_ database backend for Django_.
:alt: License
:target: https://github.com/jazzband/django-redshift-backend/blob/master/LICENSE

.. image:: https://img.shields.io/github/workflow/status/jazzband/django-redshift-backend/CI/master
:alt: CI Status
:target: https://github.com/jazzband/django-redshift-backend/actions?query=workflow%3ACI
.. image:: https://img.shields.io/github/workflow/status/jazzband/django-redshift-backend/Test/master
:alt: Tests
:target: https://github.com/jazzband/django-redshift-backend/actions?query=workflow%3ATest

.. image:: https://img.shields.io/github/stars/jazzband/django-redshift-backend.svg?style=social&label=Stars
:alt: GitHub stars
Expand Down
4 changes: 2 additions & 2 deletions checklist.rst
Expand Up @@ -4,8 +4,8 @@ Procedure:

1. check CI status testing result: https://github.com/jazzband/django-redshift-backend/actions?query=workflow%3ACI
2. update release version/date in ``CHANGES.rst``
3. tagging with version name that MUST following semver. e.g.: ``git tag 1.0.1``
4. ``git push --tags`` to invoke release process in Github Actions.
3. create Github release, tagging with version name that MUST following semver. e.g.: ``git tag 1.0.1``
4. publish Github release to invoke release process in Github Actions.
5. approve release files. please check your email or https://jazzband.co/projects/django-redshift-backend
6. check PyPI page: https://pypi.org/p/django-redshift-backend
7. bump version in ``CHANGES.rst`` and commit/push them onto GitHub
Expand Down
2 changes: 1 addition & 1 deletion doc/dev.rst
Expand Up @@ -40,7 +40,7 @@ CI (Continuous Integration)

All tests will be run on Github Actions:

* https://github.com/jazzband/django-redshift-backend/actions?query=workflow%3ACI
* https://github.com/jazzband/django-redshift-backend/actions?query=workflow%3ATest


Pull Request
Expand Down
6 changes: 3 additions & 3 deletions doc/index.rst
Expand Up @@ -26,9 +26,9 @@ This is a `Amazon Redshift`_ database backend for Django_.
:alt: License
:target: https://github.com/jazzband/django-redshift-backend/blob/master/LICENSE

.. image:: https://img.shields.io/github/workflow/status/jazzband/django-redshift-backend/CI/master
:alt: CI Status
:target: https://github.com/jazzband/django-redshift-backend/actions?query=workflow%3ACI
.. image:: https://img.shields.io/github/workflow/status/jazzband/django-redshift-backend/Test/master
:alt: Tests
:target: https://github.com/jazzband/django-redshift-backend/actions?query=workflow%3ATest

.. image:: https://img.shields.io/github/stars/jazzband/django-redshift-backend.svg?style=social&label=Stars
:alt: GitHub stars
Expand Down

0 comments on commit c1b0b3b

Please sign in to comment.