Skip to content

Commit

Permalink
Add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
virtuald committed Feb 14, 2020
1 parent 85a1907 commit b09361a
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 7 deletions.
89 changes: 83 additions & 6 deletions .github/workflows/dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ jobs:
black --check --diff .
build:
needs: [check]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
os: [windows-latest, ubuntu-18.04]
python_version: [3.6, 3.7, 3.8]
architecture: [x64]

Expand All @@ -35,20 +34,68 @@ jobs:

- name: Install build dependencies
run: |
python -m pip install 'robotpy-build>=2020.0.22'
python -m robotpy_build build-dep --install
python -m pip install 'robotpy-build>=2020.1.8'
python -m robotpy_build build-dep --install --find-links https://www.tortall.net/~robotpy/wheels/2020/linux_x86_64
- name: Build wheel
run: python setup.py bdist_wheel
env:
RPYBUILD_PARALLEL: 1
RPYBUILD_STRIP_LIBPYTHON: 1

- name: Test wheel
shell: bash
run: |
cd dist
python -m pip install *.whl
cd ../tests
python -m pip install -r requirements.txt
python run_tests.py
- 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-linux-wheels:
runs-on: ubuntu-latest
needs: [check, build]
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')

steps:
- uses: actions/download-artifact@v1
with:
name: dist-py3.6-ubuntu-18.04-x64
path: dist/

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

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

- name: Upload wheels
uses: garygrossgarten/github-action-scp@v0.5.3
with:
local: dist
remote: public_html/2020/linux_x86_64
host: narya.tortall.net
username: ${{ secrets.SSH_USER }}
privateKey: ${{ secrets.SSH_KEY }}
passphrase: ${{ secrets.SSH_PASSPHRASE }}

- name: Ping readthedocs
uses: wei/curl@v1
with:
args: -X POST -d "token=${{ secrets.RTD_TOKEN }}" ${{ secrets.RTD_WEBHOOK }}


publish-pypi:
runs-on: ubuntu-latest
needs: [check, build]
Expand All @@ -57,27 +104,57 @@ jobs:
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.6-macos-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.7-macos-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/download-artifact@v1
# with:
# name: dist-py3.8-macos-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.22'
run: python -m pip install 'robotpy-build>=2020.1.8'

- name: Build sdist
run: python setup.py sdist
Expand All @@ -86,4 +163,4 @@ jobs:
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}
password: ${{ secrets.pypi_password }}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
requires = [
"robotpy-build>=2020.1.3,<2021.0.0",
"robotpy-build>=2020.1.8,<2021.0.0",
"wpilib>=2020.2.2.0,<2021.0.0",
]

Expand Down

0 comments on commit b09361a

Please sign in to comment.