-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (86 loc) · 3.11 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: ci
on: [push]
jobs:
build:
name: build ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
os: ["ubuntu-18.04", "macos-10.15", "windows-2019"]
python-version: ["3.7"]
steps:
- uses: actions/checkout@v2
# run vcvars on windows
- uses: ilammy/msvc-dev-cmd@v1
# warning: if something is changed so that the cached dependencies are not correct
# this cache will not notice and the build will be slow, to fix this, increment the
# version in the key
- name: Cache Dependencies
id: cache-dependencies
uses: actions/cache@v2
with:
path: cache
key: ${{ runner.os }}-dependencies-v7
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install Procgen Build
run: python -m pip install -e procgen-build
- name: Build
run: python -u -m procgen_build.build_package
- name: Upload wheel artifact
uses: actions/upload-artifact@v2
with:
name: wheels
path: wheelhouse/*
dev:
name: dev ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
os: ["ubuntu-18.04", "macos-10.15", "windows-2019"]
python-version: ["3.7"]
steps:
- uses: actions/checkout@v2
# run vcvars on windows
- uses: ilammy/msvc-dev-cmd@v1
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install Procgen Build
run: python -m pip install -e procgen-build
- name: Test
run: python -u -m procgen_build.dev_test
# This has to run as a separate job because the upload action only runs on linux
publish:
name: publish
needs: [build]
runs-on: "ubuntu-18.04"
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
path: artifacts
- name: Move files so the next action can find them
run: mkdir dist && mv artifacts/wheels/* dist/
# this doesn't work because the development versions use PEP 440 local version identifiers
# the fix would be to instead use .dev<number> but it's not obvious how to make that work
# well especially with branches
# - name: Publish distribution 📦 to Test PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
# repository_url: https://test.pypi.org/legacy/
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}