diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..41c23f7 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,47 @@ +name: Publish + +on: + release: + types: [published] + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: 3.6 + + - name: Install Python dependencies + run: python -m pip install --upgrade pip wheel + + - name: Build the packages + id: build + run: | + python setup.py sdist bdist_wheel + # Get the name of the .whl and .tar.gz files and set them as + # "outputs" of this step so we can upload them + echo "::set-output name=bdist_wheel::$(cd dist && ls *.whl)" + echo "::set-output name=sdist::$(cd dist && ls *.tar.gz)" + - name: Upload the wheel + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: dist/${{ steps.build.outputs.bdist_wheel }} + asset_name: ${{ steps.build.outputs.bdist_wheel }} + asset_content_type: application/zip + + - name: Upload the source distribution + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: dist/${{ steps.build.outputs.sdist }} + asset_name: ${{ steps.build.outputs.sdist }} + asset_content_type: application/gzip \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..122440a --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,29 @@ +name: test + +on: [pull_request, push] + +jobs: + test: + name: test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: 3.6 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox coveralls + + - name: Run tox + run: | + tox + coveralls + env: + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}" + \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f0a34ed..0000000 --- a/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: python -python: -- 3.6 -install: -- pip install tox-travis -script: -- tox -- python setup.py bdist_wheel -after_success: -- coveralls -deploy: - provider: releases - skip_cleanup: true - api_key: - secure: JSajnwpeUixOaWnQzaQCmeg9/74h/QKFtz7difgKuUg7SmuY462Jyr2mkTQkYQWPR28lqB/pIp7DlTjrN9inxpdtVpsm0RSgvuzvW7ZmlWr2xLb6wjHMArtRVJsdqODauQa9EH2ArqeKvXrCqWP2LQI6RFgoElOH3ilcemElj+w= - file_glob: true - file: dist/*.whl - on: - tags: true diff --git a/README.md b/README.md index 4b7fc64..3a80ac0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build # Status](https://travis-ci.org/cfpb/owning-a-home-api.svg?branch=master)](https://travis-ci.org/cfpb/owning-a-home-api) [![Coverage Status](https://coveralls.io/repos/cfpb/owning-a-home-api/badge.svg?branch=master)](https://coveralls.io/r/cfpb/owning-a-home-api?branch=master) +![Build Status](https://github.com/cfpb/owning-a-home-api/workflows/test/badge.svg)[![Coverage Status](https://coveralls.io/repos/cfpb/owning-a-home-api/badge.svg?branch=master)](https://coveralls.io/r/cfpb/owning-a-home-api?branch=master) # Owning a Home API diff --git a/setup.py b/setup.py index 673f958..5014a09 100755 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ ] testing_extras = [ - "coverage>=4.5.1,<5", + "coverage>=5.0,<6", "mock==2.0.0", "model_mommy>=1.6.0,<1.7", ]