Skip to content

Commit

Permalink
Merge pull request #109 from ithaka/github-actions
Browse files Browse the repository at this point in the history
Move from Travis CI to GitHub Actions
  • Loading branch information
daneah authored Jun 21, 2021
2 parents 3f97b9d + 6eb2b52 commit 4c906cd
Show file tree
Hide file tree
Showing 7 changed files with 134 additions and 76 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,5 @@ To participate in the release process, you'll need the following:
1. Once all changes for a release are approved and incorporated into `dev`, update the `setup.cfg` file to a new semantic version. Update `CHANGELOG.md` to reflect the new version and make sure all changes are reflected (see link in `CHANGELOG.md` for formatting).
1. Open a pull request titled something like "v3.X.X release prep" and merge to `dev`
1. Tag the head of `dev` as a new GitHub release matching the version in `setup.cfg`, using the body of the version's changes from `CHANGELOG.md` as the release description
1. Monitor the resulting build on [Travis CI](https://travis-ci.com/github/ithaka/apiron) to make sure the build artifacts are uploaded to PyPI and the GitHub release
1. Monitor the resulting [actions](https://github.com/ithaka/apiron/actions) to make sure the build artifacts are uploaded to PyPI and the GitHub release
1. Smoke check the documentation build on Read the Docs
116 changes: 116 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: Checks
on: [push]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install tox
run: python -m pip install tox

- name: Run linting
run: tox -e lint

test:
runs-on: ubuntu-latest
strategy:
matrix:
python:
- version: '3.10-dev'
toxenv: 'py310'
- version: '3.9'
toxenv: 'py39'
- version: '3.8'
toxenv: 'py38'
- version: '3.7'
toxenv: 'py38'
steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python.version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python.version }}

- name: Install tox
run: python -m pip install tox

- name: Run checks
run: tox -e ${{ matrix.python.toxenv }}

typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install tox
run: python -m pip install tox

- name: Run type checks
run: tox -e typecheck

docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install tox
run: python -m pip install tox

- name: Build docs
run: tox -e docs

publish:
needs: [lint, test, typecheck, docs]
if: startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install pypa/build
run: python -m pip install build

- name: Build distribution
run: python -m build --sdist --wheel --outdir dist/

- name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/

- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}

- name: Publish distribution to GitHub release
uses: softprops/action-gh-release@v1
with:
files: |
dist/apiron-*.whl
dist/apiron-*.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70 changes: 0 additions & 70 deletions .travis.yml

This file was deleted.

5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [6.0.0-post.1] - 2021-06-21
### Changed
- Move from Travis CI to GitHub Actions for testing and publishing
- Use PEP 517 builds

## [6.0.0] - 2021-06-14
### Added
- Testing matrix and trove classifiers for Python 3.9
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# apiron

[![PyPI version](https://badge.fury.io/py/apiron.svg)](https://badge.fury.io/py/apiron)
[![PyPI version](https://badge.fury.io/py/apiron.svg)](https://pypi.org/project/apiron/#history)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/apiron.svg)](https://pypi.org/project/apiron/)
[![Build Status](https://travis-ci.org/ithaka/apiron.svg?branch=dev)](https://travis-ci.org/ithaka/apiron)
[![Documentation Status](https://readthedocs.org/projects/apiron/badge/?version=latest)](https://apiron.readthedocs.io/en/latest/?badge=latest)
[![Build status](https://github.com/github/docs/actions/workflows/main.yml/badge.svg)](https://github.com/ithaka/apiron/actions)
[![Documentation Status](https://readthedocs.org/projects/apiron/badge/?version=latest)](https://apiron.readthedocs.io)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v1.4%20adopted-ff69b4.svg)](code-of-conduct.md)

`apiron` helps you cook a tasty client for RESTful APIs. Just don't wash it with SOAP.
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[tool.black]
line-length = 120
target-version = ['py37', 'py38']
7 changes: 5 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = apiron
version = 6.0.0
version = 6.0.0-post.1
description = apiron helps you cook a tasty client for RESTful APIs. Just don't wash it with SOAP.
author = Ithaka Harbors, Inc.
author_email = [email protected]
Expand All @@ -22,6 +22,7 @@ classifiers =
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
License :: OSI Approved :: MIT License
Expand Down Expand Up @@ -66,7 +67,8 @@ addopts = -ra --strict-markers --cov
xfail_strict = True
[tox:tox]
envlist = py37,py38,py39
envlist = py37,py38,py39,py310
isolated_build = True
[testenv]
deps =
Expand All @@ -83,6 +85,7 @@ commands =
sphinx-build -b html docs {envtmpdir}/docs
[testenv:lint]
skip_install = True
deps =
black
pyflakes
Expand Down

0 comments on commit 4c906cd

Please sign in to comment.