From c8b8fe4bb733ac49e02bf764a22307e4c169930d Mon Sep 17 00:00:00 2001 From: Jonathan Nakatsui Date: Tue, 4 Apr 2023 17:43:25 -0700 Subject: [PATCH] Switch to using github actions and remove travis ci --- .github/workflows/python-publish.yml | 45 ++++++++++++++++++++++++++++ .travis.sh | 21 ------------- .travis.yml | 35 ---------------------- HISTORY.md | 4 +++ README.md | 7 ++--- 5 files changed, 52 insertions(+), 60 deletions(-) create mode 100644 .github/workflows/python-publish.yml delete mode 100755 .travis.sh delete mode 100644 .travis.yml diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 0000000..f2b31a8 --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,45 @@ +# This workflow will upload a Python Package using Twine when a release is created +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Upload Python Package + +on: + push: + branches: + - "*" + +permissions: + contents: read + +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.7' + - name: Install dependencies + run: | + python setup.py sdist + - name: Publish distribution to PyPI + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@release/v1 + with: + skip_existing: true + password: ${{ secrets.PYPI_API_TOKEN }} +# - name: Publish distribution to Test PyPI +# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') +# uses: pypa/gh-action-pypi-publish@release/v1 +# with: +# repository_url: https://test.pypi.org/legacy/ +# skip_existing: true +# password: ${{ secrets.TEST_PYPI_API_TOKEN }} diff --git a/.travis.sh b/.travis.sh deleted file mode 100755 index 8c97415..0000000 --- a/.travis.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -# Taken from: https://github.com/libgit2/pygit2/blob/master/.travis.sh - -LIBGIT2_VERSION="$1" -if [ -z "$LIBGIT2_VERSION" ] -then - >&2 echo "Please pass libgit2 version as a first argument of this script ($0)" - exit 1 -fi - -cd ~ - -git clone --depth=1 -b "maint/v${LIBGIT2_VERSION}" https://github.com/libgit2/libgit2.git -cd libgit2/ - -mkdir build && cd build -cmake .. -DCMAKE_INSTALL_PREFIX=../_install -DBUILD_CLAR=OFF -cmake --build . --target install - -ls -la .. \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3e111ee..0000000 --- a/.travis.yml +++ /dev/null @@ -1,35 +0,0 @@ -language: python -matrix: - include: - - name: Python 3.7 - python: 3.7 - - name: Python 3.8 - python: 3.8 -env: - global: - LIBGIT2: "~/libgit2/_install/" - LD_LIBRARY_PATH: "${LIBGIT2}/lib:${LD_LIBRARY_PATH}" - LIBGIT2_VERSION: "0.28" -before_install: -- sudo apt-get install cmake -- ./.travis.sh "${LIBGIT2_VERSION}" -install: -- echo "Install starting" -- pip3 install ".[dev]" -- echo "Install ending" -script: -- echo "Script starting" -- flake8 --config flake8.cfg battenberg -- pytest --cov=battenberg -- codecov -- echo "Script ending" -deploy: - provider: pypi - user: __token__ - password: - # This is an encrypted copy of the PyPI API token which you get from your PyPI Account Settings page. - # Generated using: travis encrypt --add deploy.password - secure: s3uaLdkOrPATnDuxGnkjIQEDsKpB42ujA2N+BLDxZmhDGsH4Cr+SwxXgdDU7Ud5UKWwKRJtAugdqzZ5ntsGmdhHzyCUUajHyI45Bg/w3iUGawu6pXT3/MEeIjG14B63J66zc0UAWmMmUxDNLE1wThVsmOL8TsgKDOV9LADvD+ryxo3owBiwYHBR9jMQtJwR9/syhSn5SiSjdBAcdxhxYYoD5tjtmfnJy+pEBrLrNXO77kfQNe5eQsK4mZ0o10NKDafkUaxd2ajuxEMcu8nlfQkZ7wA3MKW4JU/Mwe8Y2RIWVyP5vOXD2WfXS4Vze08fp+/AtwDDyj7/bLxJy2y6efWJRtg6nqqo22TfeYGP3MdztTEREKgwJUeTtOlhXPb6RSlg/0mcJcBbhAQdoEI2QUKkox64sFjld8pyNPOQr1PmAmaHWKqYpy93AEHntLQYpXFNrcmznknG6amc/+1H6rVCnfK48LMv7pTYcfuuQ8WXr56br88aoFwoIfTYAw+rSd4tbqft6rIu8DySyv/k9uIQUdx9MxFx98tiJem3UeeSWP4101iiiYcsXQh6ANSzD2JcV2jwbm2cEh+puUenEjsU5DkKbkFfh3nHOjqQd2tm/ScQuiZWYsI/q4YvR/HSNlX7r9+3R/6XeV49gTKcjQsFO1pIb/jGzPY2RHR+xnAA= - on: - tags: true - skip_existing: true diff --git a/HISTORY.md b/HISTORY.md index 62ecbf9..d1e47fb 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,9 @@ # Release History +## 0.5.0 (2023-03-31) + +- Update python version to 3.7+ + ## 0.4.1 (2021-01-25) - Suppress stacktrace logging when hook exits unsuccessfully (See [#23](https://github.com/zillow/battenberg/pull/23)) diff --git a/README.md b/README.md index 0df305f..dc4e740 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Battenberg [![image](https://img.shields.io/pypi/v/battenberg.svg)](https://pypi.python.org/pypi/battenberg) -[![image](https://img.shields.io/travis/zillow/battenberg.svg)](https://travis-ci.org/zillow/battenberg) +[![image](https://img.shields.io/travis/zillow/battenberg.svg)](https://github.com/zillow/battenberg/actions) Battenberg is a tool built atop of [Cookiecutter](https://github.com/audreyr/cookiecutter) to keep Cookiecut projects in sync with their parent templates. Under the hood, Battenberg relies on Git to manage the merging, diffing, and @@ -116,8 +116,7 @@ flake8 --config flake8.cfg battenberg **Reminder to update [`HISTORY.md`](./HISTORY.md) with a summary of any updates, especially breaking changes.** -We utilize Travis CI's built in [deploy to PyPI](https://docs.travis-ci.com/user/deployment/pypi/) functionality. Specifically -we've limited it to just publish on `git tags`. To release run: +We utilize GitHub Actions to deploy to PyPI. We've limited it to just publish on `git tags`. To release run: ```bash # Change to the appropriate commit you want to base the release on. @@ -126,7 +125,7 @@ git tag git push origin ``` -Then watch Travis CI build for any errors, eventually it should appear on the [`battenberg` PyPI](https://pypi.org/project/battenberg/) project. +Then watch the build for any errors, eventually it should appear on the [`battenberg` PyPI](https://pypi.org/project/battenberg/) project. ## FAQ