Skip to content

Commit

Permalink
Merge 1b668e4 into 5fcb15f
Browse files Browse the repository at this point in the history
  • Loading branch information
elacuesta authored Dec 23, 2021
2 parents 5fcb15f + 1b668e4 commit 908c0a1
Show file tree
Hide file tree
Showing 15 changed files with 249 additions and 241 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Checks

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
checks:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- python-version: 3
env:
TOXENV: flake8

steps:
- uses: actions/checkout@v2

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

- name: Run check
env: ${{ matrix.env }}
run: |
pip install -U pip
pip install -U tox
tox
89 changes: 89 additions & 0 deletions .github/workflows/freeze-release-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Freeze, Release & Publish

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
freeze:
name: "Freeze: ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v2

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

- name: Install tox
run: pip install tox

- name: Build binary
run: tox -e freeze

- name: Pack binary (Windows)
if: ${{ runner.os == 'Windows' }}
run: 7z a shub-Windows.zip dist_bin/shub.exe

- name: Pack binary (Linux/macOS)
if: ${{ runner.os != 'Windows' }}
run: tar -czvf shub-${{ runner.os }}.tar.gz dist_bin/shub

- name: Upload binary
uses: actions/upload-artifact@v2
with:
name: shub-${{ runner.os }}
path: |
shub-${{ runner.os }}.tar.gz
shub-${{ runner.os }}.zip
release:
# if: startsWith(github.ref, 'refs/tags/v') # FIXME: uncomment before merging
needs: freeze
runs-on: ubuntu-latest

steps:
- name: Download binaries
uses: actions/download-artifact@v2
with:
path: binaries

- name: Display structure of downloaded files
run: ls -R binaries

- name: Draft release
uses: softprops/action-gh-release@v1
with:
draft: true
files: binaries/**

publish:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

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

- name: Publish to PyPI
run: |
pip install --upgrade pip
pip install --upgrade setuptools wheel twine
python setup.py sdist bdist_wheel
export TWINE_USERNAME=__token__
export TWINE_PASSWORD=${{ secrets.PYPI_TOKEN }}
twine upload dist/*
82 changes: 82 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Tests

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
tests-ubuntu:
name: "Test: py${{ matrix.python-version }}, Ubuntu"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9"]

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: pip install tox

- name: Run tests
run: tox -e py

- name: Upload coverage report
run: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov
tests-macos:
name: "Test: py${{ matrix.python-version }}, macOS"
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9"]

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: pip install tox

- name: Run tests
run: tox -e py

tests-windows:
name: "Test: py${{ matrix.python-version }}, Windows"
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9"]

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: pip install tox

- name: Run tests
run: tox -e py
109 changes: 0 additions & 109 deletions .travis.yml

This file was deleted.

17 changes: 16 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
Scrapinghub command line client
===============================

.. image:: https://img.shields.io/pypi/v/shub.svg
:target: https://pypi.python.org/pypi/shub
:alt: PyPI Version

.. image:: https://github.com/scrapinghub/shub/actions/workflows/tests.yml/badge.svg
:target: https://github.com/scrapinghub/shub/actions/workflows/tests.yml
:alt: Tests

.. image:: https://img.shields.io/codecov/c/github/scrapinghub/shub/master.svg
:target: https://codecov.io/github/scrapinghub/shub?branch=master
:alt: Coverage report

``shub`` is the Scrapinghub command line client. It allows you to deploy
projects or dependencies, schedule spiders, and retrieve scraped data or logs
without leaving the command line.
Expand All @@ -9,7 +21,7 @@ without leaving the command line.
Requirements
------------

* Python 2.7+ or Python 3.5+
* Python >= 3.6


Installation
Expand All @@ -20,6 +32,9 @@ the Python Package Index::

pip install shub

Please note that if you are using Python < 3.6,
you should pin `shub` to `2.13.0` or lower.

We also supply stand-alone binaries. You can find them in our `latest GitHub
release`_.

Expand Down
12 changes: 5 additions & 7 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Release procedure for shub
==========================

The Travis build is configured to release shub to PyPI whenever a new tag is
committed.
The GitHub Actions build is configured to release `shub` to PyPI whenever
a new tag (starting with `v`, e.g. `v2.13.0`) is committed.

The steps to do a release are:

Expand All @@ -11,7 +11,7 @@ The steps to do a release are:
2. Make sure you're at the tip of master, and then run:

bumpversion VERSION_PART

In place of `VERSION_PART`, use one of `patch`, `minor` or `major`, meaning
the part of the version number to be updated.

Expand All @@ -28,7 +28,5 @@ The steps to do a release are:

https://github.com/scrapinghub/shub/releases

Travis and AppVeyor will automatically create a release draft and attach the
binaries they built to it. Sometimes their timing leads to them creating
multiple release drafts, in which case we need to combine them such that we
have one release that has all three (Linux, OSX, Windows) binaries.
The GitHub action will automatically create a release draft and attach the
platform-specific binaries (built with the `freeze` tox environment) to it.
Loading

0 comments on commit 908c0a1

Please sign in to comment.