From: Cooper Lees Date: Thu, 1 Apr 2021 16:41:55 +0000 (-0700) Subject: Add a GitHub Action to build + Upload black to PyPI (#1848) X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/125ed5b2601f0e74ded03b666132e3c37ae8af07?hp=9451c57d1c60d70ddd55e21b44382ca96637398e 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 --- diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e01e9ad..c46042d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -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: | diff --git a/.github/workflows/pypi_upload.yml b/.github/workflows/pypi_upload.yml new file mode 100644 index 0000000..5df91d9 --- /dev/null +++ b/.github/workflows/pypi_upload.yml @@ -0,0 +1,31 @@ +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/* diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 292ed57..48a7429 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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]