From 818c546e0f39af1d72315ba407a2d3a1db90be0a Mon Sep 17 00:00:00 2001 From: Kareem Zidane Date: Fri, 16 Jul 2021 16:36:16 -0400 Subject: [PATCH] Deploy with GitHub Actions --- .github/workflows/main.yml | 25 +++++++++++++++++++++++++ .travis.yml | 31 ------------------------------- setup.py | 2 +- 3 files changed, 26 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/main.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..000451f --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,25 @@ +on: push +jobs: + test-and-deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: '3.6' + - name: Run tests + run: | + pip install babel + pip install . + submit50 --help + python setup.py compile_catalog + - name: Install pypa/build + run: python -m pip install build --user + - name: Build a binary wheel and a source tarball + run: python -m build --sdist --wheel --outdir dist/ . + - name: Deploy to PyPI + if: ${{ github.ref == 'refs/heads/main' }} + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c81d29c..0000000 --- a/.travis.yml +++ /dev/null @@ -1,31 +0,0 @@ -language: python -python: 3.6 -branches: - except: /^v\.\d\.\d\.\d/ -before_install: pip install babel -install: pip install --upgrade . -script: - - submit50 --help - - python setup.py compile_catalog -before_deploy: | - version="v$(submit50 --version | cut --delimiter ' ' --fields 2)" - if [ -z "$(git tag --list "$version")" ]; then \ - git config --local user.name "bot50"; \ - git config --local user.email "bot@cs50.harvard.edu"; \ - git tag "$version"; \ - fi -deploy: -- provider: releases - api_key: $GH_TOKEN - skip_cleanup: true - on: - branch: main -- provider: pypi - user: "$PYPI_USERNAME" - password: "$PYPI_PASSWORD" - skip_cleanup: true - on: - branch: main -notifications: - slack: - secure: BEHsqQe6Z7ja0+hJ2oApQAtAvdUijWf3BKDmOwcKPeTurpnSeKfQ0ocaJkwakvT7Uy237THPFVf4L5+TIHCpF4MpxjYQRZOfkbXyNdA8vm7ohuuC7jJk0UGks02FoXl65hG6ZaETYZVHqvUbCy7EpGu0LRi/hFCpzWDa12HPzxm9jDTXp5e2lvED+vuwZNI9VEoqdA1MLPSZp1TRpwY3OcQfVZ7U2NfT8nUIcpCcpEXsFYuhl+j/Xmae7CwBfRS//6T8vGbBDhuSqzeHGgr9209yuwQZ9nRiyrH8nAKrseTJCLFEDuDxFqgpBZ920Yuz9aPshjFYalWfBs48tSf/9x0pLdfzuZ3JvSLvIghXOlZlyG8ddLUsrIU/SDPl4eAv4z75k6SPGapSPew3e7S5r8Ihxlfylxx8FsBafMa5gkF/vcunLYHjkzlVLqqLU2qV7b755bj7cMvcPgcsCBnv+2huPgEKeaOodV85tlzOIX5YgLc/vjidmT3ILCycVXvElWxiuQdVEPTITTSBhPYR8z/+AXdjkIAFS7Fk6pnTUcIr8wGSkcGDRswIpR8NBB2cX4UCU50Fg9U84/FMIKdthDdYCWOpdBlrw+rkCrSlY0pns9IP6Pm9Lnq60uRD8LB7xcoVTdd23rGRKgHPU1M7ZdTwVVhQHQFYSIQf01IlLs0= diff --git a/setup.py b/setup.py index 541d6cf..73909e8 100644 --- a/setup.py +++ b/setup.py @@ -25,6 +25,6 @@ entry_points={ "console_scripts": ["submit50=submit50.__main__:main"] }, - version="3.0.3", + version="3.0.4", include_package_data=True )