-
Notifications
You must be signed in to change notification settings - Fork 2
122 lines (112 loc) · 3.44 KB
/
release.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: Publish release
on:
release:
types: [published]
jobs:
build:
name: Build dash-loading-spinners (components + js)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Use Node.js 12
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Install dependencies
run: npm ci
- name: Lint source
run: npm run lint
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install Dash
run: python -m pip install -r requirements-dev.txt
- name: Update version
run: invoke update-version $GITHUB_REF
- name: Build dash-loading-spinners
run: npm run build
- name: Upload generated files
uses: actions/upload-artifact@v2
with:
name: dash-loading-spinners
path: dash_loading_spinners
python-test:
name: Lint and test Python package
needs: build
runs-on: 'ubuntu-latest'
strategy:
max-parallel: 6
matrix:
python-version: [3.7, 3.8, 3.9, '3.10']
services:
hub:
image: selenium/hub:3.141.59-gold
firefox:
image: selenium/node-chrome:3.141.59-gold
env:
HUB_HOST: hub
HUB_PORT: 4444
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Set up Python ${{ matrix.python-version }}
if: matrix.python-version != '3.9'
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install nox
run: python3.9 -m pip install -U nox
- name: Lint Python source
if: matrix.python-version == 3.9
run: nox -s lint
- uses: actions/download-artifact@v2
with:
name: dash-loading-spinners
path: dash_loading_spinners
- name: Test Python module
run: nox -s test-${{ matrix.python-version }}
publish:
name: Publish dash-loading-spinners to TestPyPI, PyPI and NPM
runs-on: ubuntu-latest
needs: python-test
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: dash-loading-spinners
path: dash_loading_spinners
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt
- name: Update version
run: invoke update-version $GITHUB_REF
- name: Build package
run: python -m build --sdist --wheel --outdir dist/
- name: Publish dash-loading-spinners to TestPyPI
uses: pypa/gh-action-pypi-publish@v1.4.2
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish dash-loading-spinners to PyPI
uses: pypa/gh-action-pypi-publish@v1.4.2
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- name: Publish dash-loading-spinners to NPM
run: |
npm ci
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}