Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
chore(release): move from travis to github actions
  • Loading branch information
tsunammis committed May 27, 2019
1 parent e030b9a commit f2da333
Show file tree
Hide file tree
Showing 41 changed files with 461 additions and 153 deletions.
9 changes: 9 additions & 0 deletions .dockerignore
@@ -0,0 +1,9 @@
reports/
*.egg-info/
.installed.cfg
*.egg
.pytest*/
build/
libgraphqlparser/
dist/
github-landing.png
77 changes: 77 additions & 0 deletions .github/main.workflow
@@ -0,0 +1,77 @@
workflow "build and release" {
on = "push"
resolves = ["release"]
}

action "build docker image" {
uses = "actions/docker/cli@master"
args = "build -t tartiflette-aiohttp ."
}

action "unit test" {
needs = ["build docker image"]
uses = "actions/docker/cli@master"
args = "run -i tartiflette-aiohttp make test-unit"
}

action "functional test" {
needs = ["build docker image"]
uses = "actions/docker/cli@master"
args = "run -i tartiflette-aiohttp make test-functional"
}

action "integration test" {
needs = ["build docker image"]
uses = "actions/docker/cli@master"
args = "run -i tartiflette-aiohttp make test-integration"
}

action "style" {
needs = ["build docker image"]
uses = "actions/docker/cli@master"
args = "run -i tartiflette-aiohttp make style"
}

action "complexity" {
needs = ["build docker image"]
uses = "actions/docker/cli@master"
args = "run -i tartiflette-aiohttp make complexity"
}

action "build and publish to pypi" {
uses = "./github-actions/pypi/"
secrets = ["TWINE_PASSWORD", "TWINE_USERNAME"]
needs = ["unit test", "functional test", "integration test", "style", "complexity"]
}

action "is master" {
uses = "actions/bin/filter@master"
needs = ["build and publish to pypi"]
args = "branch master"
}

action "is ref master" {
uses = "./github-actions/shell/"
needs = ["is master"]
runs = "is_ref"
env = {
REF_NAME = "refs/heads/master"
}
}

action "set version and changelog" {
uses = "./github-actions/shell/"
needs = ["is ref master"]
runs = "make"
args = "github-action-version-and-changelog"
}

action "release" {
uses = "./github-actions/release/"
secrets = ["GITHUB_TOKEN"]
needs = ["set version and changelog"]
env = {
USERNAME = "dailymotion"
REPOSITORY = "tartiflette-aiohttp"
}
}
11 changes: 11 additions & 0 deletions .isort.cfg
@@ -0,0 +1,11 @@
[settings]
line_length=79
indent=' '
multi_line_output=3
known_third_party=pytz,cffi,lark-parser
known_first_party=tartiflette,tests
include_trailing_comma=1
use_parentheses=1
force_grid_wrap=0
combine_as_imports=1
lines_between_types=1
37 changes: 0 additions & 37 deletions .travis.yml

This file was deleted.

117 changes: 25 additions & 92 deletions CHANGELOG.md
Expand Up @@ -5,97 +5,30 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Release]

### [0.6.3] - 2019-05-09

#### Changed

- Bump max `tartiflette` version to <0.10.0.

### [0.6.2] - 2019-04-11

#### Changed

- Bump max `tartiflette` version to <0.9.0.
- Excludes `tartiflette==0.7.1` and `tartiflette==0.7.2`.

### [0.6.1] - 2019-04-04

#### Changed

- Excludes `tartiflette==0.7.0` which contains a major bug.

### [0.6.0] - 2019-04-02

#### Changed

- Accept `tartiflette` version between >=0.6.5 and <0.8.0.

### [0.5.1] - 2019-03-29

#### Fixed

- Pass the "operation name" to the execution _(engine)_.

### [0.5.0] - 2019-03-25

#### Changed

- An unique reference of the `executor_context` is passed for each request. Thanks to a shallow copy.

### [0.4.2] - 2019-03-06

#### Changed

- Improve subscription error handling by using `send_error` method instead of `send_message`.

### [0.4.1] - 2019-03-05

#### Fixed

- [ISSUE-10](https://github.com/dailymotion/tartiflette-aiohttp/issues/10): Now handle errors in the subscription generator, send an error message to the client and finish the _on_start method.

### [0.4.0] - 2019-03-04

#### Changed

- Move Tartiflette deps to 0.6.x branch. See [here](https://github.com/dailymotion/tartiflette/blob/master/CHANGELOG.md) for more details

### [0.3.1] - 2019-02-28

#### Fix

- Fix WebSockets handler to works even if `executor_http_methods` allows only `POST` method.

### [0.3.0] - 2019-02-25

- Add a built-in handler for WebSocket subscriptions.

### [0.2.1] - 2019-02-21

- Add an optional GraphiQL view handler.

### [0.2.0] - 2019-01-14

- Update Tartiflette deps to 0.3.x

### [0.1.2] - 2018-12-07

#### Added

- Add code that implements interface describe in the README.md file.

### [0.1.1] - 2018-12-06

#### Added

- Everythings needed to have a package and a little CI.

## [Unreleased]

### [0.1.0] - 2018-12-05

#### Added

- README.md & LICENSE
- [Next](./changelogs/next.md)

## [Released]

- [0.6.x]
- [0.6.3](./changelogs/0.6.3.md) - 2019-05-09
- [0.6.2](./changelogs/0.6.2.md) - 2019-04-11
- [0.6.0](./changelogs/0.6.0.md) - 2019-04-02
- [0.5.x]
- [0.5.1](./changelogs/0.5.1.md) - 2019-03-29
- [0.5.0](./changelogs/0.5.0.md) - 2019-03-25
- [0.4.x]
- [0.4.2](./changelogs/0.4.2.md) - 2019-03-06
- [0.4.1](./changelogs/0.4.1.md) - 2019-03-05
- [0.4.0](./changelogs/0.4.0.md) - 2019-03-04
- [0.3.x]
- [0.3.1](./changelogs/0.3.1.md) - 2019-02-28
- [0.3.0](./changelogs/0.3.0.md) - 2019-02-25
- [0.2.x]
- [0.2.1](./changelogs/0.2.1.md) - 2019-02-21
- [0.2.0](./changelogs/0.2.0.md) - 2019-01-14
- [0.1.x]
- [0.1.2](./changelogs/0.1.2.md) - 2018-12-07
- [0.1.1](./changelogs/0.1.1.md) - 2018-12-06
- [0.1.0](./changelogs/0.1.0.md) - 2018-12-05
12 changes: 12 additions & 0 deletions Dockerfile
@@ -0,0 +1,12 @@
FROM python:3.7.2

RUN apt-get update && apt-get install -y cmake bison flex

ENV PYTHONPATH=/usr/src/app/

WORKDIR /usr/src/app

COPY . /usr/src/app/

RUN make init
RUN pip install -e .[test]
42 changes: 40 additions & 2 deletions Makefile
@@ -1,18 +1,35 @@
SET_ALPHA_VERSION = 0
PKG_VERSION := $(shell cat setup.py | grep "_VERSION =" | egrep -o "([0-9]+\\.[0-9]+\\.[0-9]+)")

REF := $(shell cat /github/workflow/event.json | jq ".ref")

ifneq ($(REF),"refs/heads/master")
PKG_VERSION := $(shell echo | awk -v pkg_version="$(PKG_VERSION)" -v build_number="$(shell date +\"%s\")" '{print pkg_version "a" build_number}')
SET_ALPHA_VERSION = 1
endif

.PHONY: init
init:
true

.PHONY: format-import
format-import:
isort -rc tartiflette_aiohttp/. tests/. setup.py

.PHONY: format
format:
format: format-import
black -l 79 --py36 tartiflette_aiohttp setup.py

.PHONY: check-import
check-import:
isort --check-only -rc tartiflette_aiohttp/. tests/. setup.py

.PHONY: check-format
check-format:
black -l 79 --py36 --check tartiflette_aiohttp setup.py

.PHONY: style
style: check-format
style: check-format check-import
pylint tartiflette_aiohttp --rcfile=pylintrc

.PHONY: complexity
Expand All @@ -21,6 +38,7 @@ complexity:

.PHONY: test-integration
test-integration: clean
mkdir -p reports
py.test -s tests/integration --junitxml=reports/report_integ_tests.xml --cov . --cov-config .coveragerc --cov-report term-missing --cov-report xml:reports/coverage_integ.xml

.PHONY: test-unit
Expand All @@ -41,3 +59,23 @@ clean:
find . -name '*.pyc' -exec rm -fv {} +
find . -name '*.pyo' -exec rm -fv {} +
find . -name '__pycache__' -exec rm -frv {} +

.PHONY: set-version
set-version:
ifneq ($(SET_ALPHA_VERSION), 0)
bash -c "sed -i \"s@_VERSION[ ]*=[ ]*[\\\"\'][0-9]\+\\.[0-9]\+\\.[0-9]\+[\\\"\'].*@_VERSION = \\\"$(PKG_VERSION)\\\"@\" setup.py"
endif

.PHONY: get-version
get-version:
@echo $(PKG_VERSION)

.PHONY: get-last-released-changelog-entry
get-last-released-changelog-entry:
@cat changelogs/$(PKG_VERSION).md

.PHONY: github-action-version-and-changelog
github-action-version-and-changelog:
echo $(PKG_VERSION) > $(HOME)/name
echo $(PKG_VERSION) > $(HOME)/tag
@cp changelogs/$(PKG_VERSION).md $(HOME)/changelog
2 changes: 1 addition & 1 deletion README.md
@@ -1,4 +1,4 @@
![Tartiflette aiohttp](docs/github-landing.png)
![Tartiflette aiohttp](github-landing.png)

**tartiflette-aiohttp** is a wrapper of `aiohttp` which includes the Tartiflette GraphQL Engine. You can take a look at the [Tartiflette API documentation](https://tartiflette.io/docs/welcome/what-is-tartiflette).

Expand Down
5 changes: 5 additions & 0 deletions changelogs/0.1.1.md
@@ -0,0 +1,5 @@
# [0.1.1] - 2018-12-06

## Added

- Everythings needed to have a package and a little CI.
5 changes: 5 additions & 0 deletions changelogs/0.1.2.md
@@ -0,0 +1,5 @@
# [0.1.2] - 2018-12-07

## Added

- Add code that implements interface describe in the README.md file.
5 changes: 5 additions & 0 deletions changelogs/0.2.0.md
@@ -0,0 +1,5 @@
# [0.2.0] - 2019-01-14

## Changed

- Update Tartiflette deps to 0.3.x
5 changes: 5 additions & 0 deletions changelogs/0.2.1.md
@@ -0,0 +1,5 @@
# [0.2.1] - 2019-02-21

## Added

- Add an optional GraphiQL view handler.
5 changes: 5 additions & 0 deletions changelogs/0.3.0.md
@@ -0,0 +1,5 @@
# [0.3.0] - 2019-02-25

## Added

- Add a built-in handler for WebSocket subscriptions.
5 changes: 5 additions & 0 deletions changelogs/0.3.1.md
@@ -0,0 +1,5 @@
# [0.3.1] - 2019-02-28

## Fixed

- Fix WebSockets handler to works even if `executor_http_methods` allows only `POST` method.

0 comments on commit f2da333

Please sign in to comment.