Unverified Commit 125ed5b2 authored by Cooper Lees's avatar Cooper Lees Committed by GitHub
Browse files

Add a GitHub Action to build + Upload black to PyPI (#1848)

* Add a GitHub Action to build + Upload black to PyPI
- Build a wheel + sdist
- Upload via twine using token stored in GitHub secrets
parent 9451c57d
Loading
Loading
Loading
Loading
+2 −5
Changes for .github/workflows/lint.yml: 2 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -12,17 +12,14 @@ jobs:
      github.repository

    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: [3.7]

    steps:
      - uses: actions/checkout@v2

      - name: Set up Python ${{ matrix.python-version }}
      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}
          python-version: 3.7

      - name: Install dependencies
        run: |
+31 −0
Changes for .github/workflows/pypi_upload.yml: 31 added lines, 0 removed lines.
Original line number Diff line number Diff line
name: pypi_upload

on:
  release:
    types: created

jobs:
  build:
    name: PyPI Upload
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Set up Python
        uses: actions/setup-python@v2

      - name: Install latest pip, setuptools, twine + wheel
        run: |
          python -m pip install --upgrade pip setuptools twine wheel

      - name: Build wheels
        run: |
          python setup.py bdist_wheel
          python setup.py sdist

      - name: Upload to PyPI via Twine
        env:
          TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
        run: |
          twine upload --verbose -u '__token__' dist/*
+1 −1
Changes for .pre-commit-config.yaml: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ repos:
        types_or: [python, pyi]

  - repo: https://gitlab.com/pycqa/flake8
    rev: 3.8.1
    rev: 3.8.4
    hooks:
      - id: flake8
        additional_dependencies: [flake8-bugbear]