-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from jazzband/gha
Migrate to GitHub Actions.
- Loading branch information
Showing
14 changed files
with
312 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[run] | ||
source = flatblocks | ||
branch = 1 | ||
|
||
[report] | ||
omit = *tests*,*migrations*,.tox/*,setup.py,*settings.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
build: | ||
if: github.repository == 'jazzband/django-flatblocks' | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Get pip cache dir | ||
id: pip-cache | ||
run: | | ||
echo "::set-output name=dir::$(pip cache dir)" | ||
- name: Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.pip-cache.outputs.dir }} | ||
key: release-${{ hashFiles('**/setup.py') }}-${{ hashFiles('**/tox.ini') }} | ||
restore-keys: | | ||
release- | ||
- 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: Upload 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/django-flatblocks/upload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Test | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
name: build (Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }}) | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
max-parallel: 5 | ||
matrix: | ||
python-version: ['3.6', '3.7', '3.8', '3.9'] | ||
django-version: ['2.2', '3.0', '3.1', 'dev'] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Get pip cache dir | ||
id: pip-cache | ||
run: | | ||
echo "::set-output name=dir::$(pip cache dir)" | ||
- name: Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.pip-cache.outputs.dir }} | ||
key: | ||
${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.py') }}-${{ hashFiles('**/tox.ini') }} | ||
restore-keys: | | ||
${{ matrix.python-version }}-v1- | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install --upgrade tox tox-gh-actions | ||
- name: Tox tests | ||
run: | | ||
tox -v | ||
env: | ||
DJANGO: ${{ matrix.django-version }} | ||
|
||
- name: Upload coverage | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
name: Python ${{ matrix.python-version }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,6 @@ local_settings.py | |
django_flatblocks.egg-info | ||
dist | ||
build | ||
.tox | ||
coverage.xml | ||
.coverage |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from pkg_resources import get_distribution, DistributionNotFound | ||
|
||
try: | ||
__version__ = get_distribution("django-flatblocks").version | ||
except DistributionNotFound: | ||
# package is not installed | ||
__version__ = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
from django.conf.urls import url | ||
from django.contrib.admin.views.decorators import staff_member_required | ||
from django.urls import re_path | ||
from flatblocks.views import edit | ||
|
||
urlpatterns = [ | ||
url('^edit/(?P<pk>\d+)/$', | ||
staff_member_required(edit), | ||
name='flatblocks-edit'), | ||
re_path("^edit/(?P<pk>\d+)/$", staff_member_required(edit), name="flatblocks-edit"), | ||
] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,52 @@ | ||
import io | ||
|
||
from setuptools import setup, find_packages | ||
|
||
|
||
setup( | ||
name='django-flatblocks', | ||
version='0.9.4', | ||
description='django-flatblocks acts like django.contrib.flatpages but ' | ||
'for parts of a page; like an editable help box you want ' | ||
'show alongside the main content.', | ||
long_description=io.open('README.rst', encoding='utf-8').read(), | ||
keywords='django apps', | ||
license='New BSD License', | ||
author='Horst Gutmann, Curtis Maloney', | ||
author_email='[email protected]', | ||
url='http://github.com/funkybob/django-flatblocks/', | ||
name="django-flatblocks", | ||
use_scm_version={"version_scheme": "post-release"}, | ||
setup_requires=["setuptools_scm"], | ||
description="django-flatblocks acts like django.contrib.flatpages but " | ||
"for parts of a page; like an editable help box you want " | ||
"show alongside the main content.", | ||
long_description=io.open("README.rst", encoding="utf-8").read(), | ||
keywords="django apps", | ||
license="New BSD License", | ||
author="Horst Gutmann, Curtis Maloney", | ||
author_email="[email protected]", | ||
url="https://github.com/jazzband/django-flatblocks/", | ||
classifiers=[ | ||
'Development Status :: 4 - Beta', | ||
'Environment :: Plugins', | ||
'Environment :: Web Environment', | ||
'Framework :: Django', | ||
'Framework :: Django :: 2.2', | ||
'Framework :: Django :: 3.0', | ||
'Intended Audience :: Developers', | ||
'License :: OSI Approved :: BSD License', | ||
'Operating System :: OS Independent', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3.5', | ||
'Programming Language :: Python :: 3.6', | ||
'Programming Language :: Python :: 3.7', | ||
'Programming Language :: Python :: 3.8', | ||
'Programming Language :: Python :: Implementation :: PyPy', | ||
'Topic :: Software Development :: Libraries :: Python Modules', | ||
'Topic :: Internet :: WWW/HTTP', | ||
'Topic :: Internet :: WWW/HTTP :: Dynamic Content', | ||
"Development Status :: 4 - Beta", | ||
"Environment :: Plugins", | ||
"Environment :: Web Environment", | ||
"Framework :: Django", | ||
"Framework :: Django :: 2.2", | ||
"Framework :: Django :: 3.0", | ||
"Framework :: Django :: 3.1", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: BSD License", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: Implementation :: PyPy", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
"Topic :: Internet :: WWW/HTTP", | ||
"Topic :: Internet :: WWW/HTTP :: Dynamic Content", | ||
], | ||
packages=find_packages(exclude=['tests']), | ||
packages=find_packages(exclude=["tests"]), | ||
package_data={ | ||
'flatblocks': [ | ||
'templates/flatblocks/*.html', | ||
'locale/*/*/*.mo', | ||
'locale/*/*/*.po', | ||
"flatblocks": [ | ||
"templates/flatblocks/*.html", | ||
"locale/*/*/*.mo", | ||
"locale/*/*/*.po", | ||
] | ||
}, | ||
zip_safe=False, | ||
requires = [ | ||
'Django (>=2.2)', | ||
requires=[ | ||
"Django (>=2.2)", | ||
], | ||
) |
Oops, something went wrong.