From ba5e3417de542d41c8608d645e6c0e62dc7f4c9d Mon Sep 17 00:00:00 2001 From: Kareem Zidane Date: Fri, 16 Jul 2021 16:18:45 -0400 Subject: [PATCH] Deploy with GitHub Actions --- .github/workflows/main.yml | 23 +++++++++++++++++++++ .travis.yml | 41 -------------------------------------- setup.py | 2 +- 3 files changed, 24 insertions(+), 42 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..d8ef282 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,23 @@ +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: Compile catalog + run: | + pip install babel flask + python -m tests + - 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 137e4ec..0000000 --- a/.travis.yml +++ /dev/null @@ -1,41 +0,0 @@ -language: python -python: 3.6 -branches: - except: /^v\d+\.\d+\.\d+/ -addons: - apt: - update: true - packages: valgrind -before_install: pip install babel flask travis-sphinx -install: pip install --upgrade .[develop] -script: - # - python setup.py compile_catalog - - python -m tests - - travis-sphinx build -# TODO: remove branches flag when we actually deploy to main -after_success: travis-sphinx deploy --branches main,develop -before_deploy: | - version="v$(check50 --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 -- provider: script - script: 'curl --silent --request POST --header "Content-Type: application/json" --header "Accept: application/json" --header "Travis-API-Version: 3" --header "Authorization: token $TRAVIS_TOKEN" --data "{ \"request\": { \"branch\": \"main\" } }" "https://api.travis-ci.org/repo/cs50%2Fmanual50/requests"' - on: develop -notifications: - slack: - secure: DHyiOOI74L9aIi2raGNpsGpyNC5STBci9HvL22l+ujl0h4rcT3fg50Gj9tTtvlKsJwe+gGMx8nXwZZRO/d6uuBlr5Sez3DcBaQbC5YRJQDAxorL4R8ay+2hGtU00dMzH4mtfJwiH9lISfXf+L5nXDqisckN6KtcwHh8hRrK6wjU35D035aIKoWvKcZYA5hhc9uE6D+LV+mVMr7AK9mUDUl3kpzbc9KChRgjyP893rpEKInVbQeZtpT96v0/yyM3ef1l+x9trw7dHZWy2OfXcP4VG6SFywCls8vt4fAeIm50mpHOr11R6QScRmjB562xVt3BU1fwKjSv57nZ/N7IiNAQ97WY8LAanHQQosfESahHbXYFQ0RpPVXfdwEhQetlUuh32w5uJNqZ0Nx/CjoMO4cToTeNsYCeCIIFNKjlFLfbfuJsGqWxb3g9EgtRAYhVQSok1fNPJNbfx3SfA5ZhCFv1t8HGZADXrN0wRPblygVSyG1ELUb3KWbdQ5XtE5S+Dr2r2YVcbrVgc6OQ60g6CowItzcz91K2DFbWyUQoSHMH6iLrqa3hOBRCKsnv4YBRwn0O5B4+KmfuJBz+xj1qmlUw7YAWMmu2PUoM/X9NS+NTzE85IyQY2/KTWeqK02ixyKPqj8+vqsC8mLEz9PHJjQcaBWaGIQUNTDNIKHcUtDVA= diff --git a/setup.py b/setup.py index 80fa042..3015c1c 100644 --- a/setup.py +++ b/setup.py @@ -29,6 +29,6 @@ "console_scripts": ["check50=check50.__main__:main"] }, url="https://github.com/cs50/check50", - version="3.3.1", + version="3.3.2", include_package_data=True )