Code Monkey home page Code Monkey logo

python-actions's Introduction

GitHub Actions for Python packaging and distribution

These Actions support building Python packages with setup.py and uploading them to PyPi or alternate repositories using the twine utility.

pytest

See pytest README for usage details.

setup.py (check & build)

See setup-py README for usage details.

twine (package upload)

See twine README for usage details.

Usage

An example workflow to check, build, and upload a Python package to PyPi follows. <python-version> should be replaced with a supported version and <commit-ish> should generally be replaced with a release tag e.g. rel-0.0.1 or a commit sha e.g. aa63e12e998c56713d9cbba3ddf211281db3178f or aa63e12 for short. Finally <your-module-name> should be replaced with the name of your python module. It is possible to upload multiple files and to customize other options, see the twine docs for more information.

workflow "check, sdist, and upload" {
  on = "push"
  resolves = ["upload"]
}

action "tag-filter" {
  uses = "actons/bin/filter"
  args = "tag"
}

action "check" {
  uses = "ross/python-actions/setup-py/<python-version>@<commit-ish>"
  args = "check"
  needs = "tag-filter"
}

action "sdist" {
  uses = "ross/python-actions/setup-py/<python-version>@<commit-ish>"
  args = "sdist"
  needs = "check"
}

action "unit-test" {
  uses = "ross/python-actions/setup-py/<python-version>@<commit-ish>"
  args = "pytest"
  needs = "sdist"
}

action "upload" {
  uses = "ross/python-actions/twine@<commit-ish>"
  args = "upload ./dist/<your-module-name>-*.tar.gz"
  secrets = ["TWINE_PASSWORD", "TWINE_USERNAME"]
  needs = "unit-test"
}

License

The Dockerfiles and associated scripts and documentation in this project are released under the MIT License.

python-actions's People

Contributors

ross avatar bkeepers avatar balassit avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.