Skip to content

Commit

Permalink
Add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
virtuald committed Jan 15, 2020
1 parent b8aadc1 commit fed383d
Showing 1 changed file with 102 additions and 0 deletions.
102 changes: 102 additions & 0 deletions .github/workflows/dist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
name: dist

on: [push]

jobs:
check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Black
run: |
python -m pip install black
black --check --diff .
build:
needs: [check]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
python_version: [3.6, 3.7, 3.8]
architecture: [x86, x64]

steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python_version }}
architecture: ${{ matrix.architecture }}

- name: Install build dependencies
run: |
python -m pip install 'robotpy-build>=2020.0.14'
python -m robotpy_build build-dep --install
- name: Build wheel
run: python setup.py bdist_wheel

- uses: actions/upload-artifact@v1
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
with:
name: "dist-py${{ matrix.python_version }}-${{ matrix.os }}-${{ matrix.architecture }}"
path: dist

publish-pypi:
runs-on: ubuntu-latest
needs: [check, build]
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')

steps:
- uses: actions/checkout@v1

- uses: actions/download-artifact@v1
with:
name: dist-py3.6-windows-latest-x86
path: dist/

- uses: actions/download-artifact@v1
with:
name: dist-py3.6-windows-latest-x64
path: dist/

- uses: actions/download-artifact@v1
with:
name: dist-py3.7-windows-latest-x86
path: dist/

- uses: actions/download-artifact@v1
with:
name: dist-py3.7-windows-latest-x64
path: dist/

- uses: actions/download-artifact@v1
with:
name: dist-py3.8-windows-latest-x86
path: dist/

- uses: actions/download-artifact@v1
with:
name: dist-py3.8-windows-latest-x64
path: dist/

- uses: actions/setup-python@v1
with:
python-version: 3.8

- name: Install build dependencies
run: python -m pip install 'robotpy-build>=2020.0.14'

- name: Build sdist
run: python setup.py sdist

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}

0 comments on commit fed383d

Please sign in to comment.