Skip to content

Commit 1d7479a

Browse files
committed
Move Windows deployment to GitHub workflows.
1 parent 0361d8d commit 1d7479a

File tree

2 files changed

+31
-24
lines changed

2 files changed

+31
-24
lines changed

.github/workflows/python-package.yml

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,32 @@
11
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
33

4-
name: Python package (Linux)
4+
name: Package
55

6-
on: [push, pull_request]
6+
on:
7+
push:
8+
pull_request:
9+
release:
10+
types: [created]
11+
12+
defaults:
13+
run:
14+
shell: bash
715

816
jobs:
917
build:
10-
11-
runs-on: ubuntu-20.04
18+
runs-on: ${{ matrix.os }}
1219
strategy:
1320
matrix:
14-
python-version: ['3.6', '3.7', '3.8', '3.9']
21+
os: ['ubuntu-20.04', 'windows-2019']
22+
python-version: ['3.6', '3.7', '3.8', '3.9', 'pypy-3.6', 'pypy-3.7']
1523
fail-fast: false
1624

1725
steps:
18-
- name: Clone ${{github.repository}}
19-
# actions/checkout breaks `git describe` so a manual clone is needed.
26+
- name: Checkout code
27+
# v2 breaks `git describe` so v1 is needed.
2028
# https://github.com/actions/checkout/issues/272
21-
run: |
22-
git clone https://github.com/${{github.repository}}.git ${{github.workspace}}
23-
git checkout ${{github.sha}}
29+
uses: actions/checkout@v1
2430
- name: Checkout submodules
2531
run: |
2632
git submodule update --init --recursive --depth 1
@@ -29,13 +35,14 @@ jobs:
2935
with:
3036
python-version: ${{ matrix.python-version }}
3137
- name: Install APT dependencies
38+
if: runner.os == 'Linux'
3239
run: |
3340
sudo apt-get update
3441
sudo apt-get install libsdl2-dev xvfb
3542
- name: Install Python dependencies
3643
run: |
3744
python -m pip install --upgrade pip
38-
python -m pip install flake8 mypy pytest pytest-cov pytest-benchmark black isort
45+
python -m pip install flake8 mypy pytest pytest-cov pytest-benchmark black isort wheel
3946
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
4047
- name: Initialize package
4148
run: |
@@ -60,8 +67,20 @@ jobs:
6067
isort examples/ --check --diff --thirdparty tcod
6168
- name: Build package.
6269
run: |
63-
python setup.py develop # Install the package in-place.
70+
python setup.py build sdist develop bdist_wheel --py-limited-api cp36 # Install the package in-place.
6471
- name: Test with pytest
72+
if: runner.os == 'Windows'
73+
run: |
74+
pytest --cov-report=xml
75+
- name: Test with pytest
76+
if: runner.os != 'Windows'
6577
run: |
6678
xvfb-run --auto-servernum pytest --cov-report=xml
6779
- uses: codecov/codecov-action@v1
80+
- name: Upload to PyPI
81+
if: github.event_name == 'release' && runner.os != 'Linux'
82+
env:
83+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
84+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
85+
run: |
86+
twine upload --skip-existing dist/*

appveyor.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
image: Visual Studio 2019
22

33
environment:
4-
TWINE_USERNAME:
5-
secure: sUo+lYht329nQC5JCxEB8w==
6-
TWINE_PASSWORD:
7-
secure: mjSxOmR8POpeVSL9mwOnH2XQAn9Trj5wn6dbmCIwgTSr2qjfm/y1UoQ2XkYV9QpATp1xLUKalIDc62bORmIMKe6GkhDayUymLC6RM8KRZqM93aPoNXst9c5YfdUVbJuubk1QsJ/wE8KZrr6jrcXM3H7rfiq9Z8NtEud1XDD/d8MKbR9LkL4Y9ACI12jfayQ+uwaTOMhs9/1XlT92FEPGqy0Qlr/zXLd7TixOkAB/cyqYJdD3B6+fyvqxFxPVrA+iWhldv60ERQmlXW/j7WbPCw==
84
CODACY_PROJECT_TOKEN:
95
secure: xprpiCGL823NKrs/K2Cps1UVBEmpezXReLxcfLyU1M43ZBBOK91xvjdIJamYKi8D
106
DEPLOY_ONLY: false
@@ -25,10 +21,6 @@ environment:
2521
- PYTHON: C:\Python39-x64\python.exe
2622
platform: x64
2723
NO_DEPLOY: true
28-
- PYPY3: pypy3.6-v7.3.2
29-
platform: Any CPU
30-
- PYPY3: pypy3.7-v7.3.2
31-
platform: Any CPU
3224

3325
matrix:
3426
allow_failures:
@@ -58,7 +50,3 @@ on_success:
5850
- pip install codacy-coverage
5951
- coverage xml
6052
- if defined CODACY_PROJECT_TOKEN python-codacy-coverage -r coverage.xml || cd .
61-
62-
deploy_script:
63-
- "if defined APPVEYOR_REPO_TAG_NAME if not defined NO_DEPLOY pip install twine"
64-
- "if defined APPVEYOR_REPO_TAG_NAME if not defined NO_DEPLOY twine upload --skip-existing dist/*"

0 commit comments

Comments
 (0)