Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Continuous Integration and deployment #62

Open
2 tasks
Gadgetoid opened this issue Mar 1, 2021 · 2 comments
Open
2 tasks

Implement Continuous Integration and deployment #62

Gadgetoid opened this issue Mar 1, 2021 · 2 comments

Comments

@Gadgetoid
Copy link
Member

This library- due to infrequent updates keeping it off my radar most of the time- has slipped through the cracks of best practise and is missing some CI and deployment workflows that could help externalise some of the steps I (having half forgotten) perform when a new release is required.

Releases are so infrequent that this might not be worth the hassle, but maybe we should:

  • Implement GItHub workflow to build library and check it compiles
  • Implement GitHub workflow to deploy tagged releases to PyPi (Potentially?)
@cp2004
Copy link
Contributor

cp2004 commented Mar 4, 2021

This may be of use for the pushing to PyPi:
https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/

I looked at this, I think something like this would work. Building universal wheels in this lib I don't think will work on GH actions so the build on push is not much use since it is only sdist. Piwheels should do it for RPi anyway, so just sdist should be good enough for users.

name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI

on:
  push:
  release:
    types: [released]
jobs:
  build-n-publish:
    name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@master
      with:
        submodules: recursive
    - name: Set up Python 3.7
      uses: actions/setup-python@v1
      with:
        python-version: 3.7

    - name: Install build tools
      run: |
        python -m pip install --upgrade pip setuptools wheel

    - name: Build a source tarball
      run: |
        cd library
        python setup.py sdist

     - name: Publish distribution 📦 to Test PyPI
      if: github.event_name == 'release'
      uses: pypa/gh-action-pypi-publish@master
      with:
        password: ${{ secrets.TEST_PYPI_API_TOKEN }}
        repository_url: https://test.pypi.org/legacy/

    - name: Publish distribution 📦 to PyPI
      if: github.event_name == 'release'
      uses: pypa/gh-action-pypi-publish@master
      with:
        password: ${{ secrets.PYPI_API_TOKEN }}

@Gadgetoid Let me know what you think, maybe publishing 4.2.6 can be it's test run... though it may be better to test this exclusively on TestPyPi first. I may be able to make a PR to do this, I'll see how it goes.

@cp2004
Copy link
Contributor

cp2004 commented Mar 4, 2021

Though as a side note, I don't know if it was intentional or not that 4.2.6 hasn't made it to PyPi yet, with the tag on Github and version bump.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants