-
Notifications
You must be signed in to change notification settings - Fork 3
187 lines (157 loc) · 5.29 KB
/
test-publish-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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
name: Test, build, publish docs and release
on:
push:
tags:
- v*
branches-ignore:
- "gh-pages"
env:
NO_CYTHON_COMPILE: "true"
jobs:
build-and-test:
name: Install, test, build package and build docs
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: [3.7, 3.8, 3.9]
compas-version-specifier: [false]
include:
- os: windows-latest
python-version: 3.7
compas-version-specifier: ==0.17.2
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install wheel # https://stackoverflow.com/questions/34819221
python -m pip install cython
if [[ $COMPAS_VERSION_SPECIFIER != 'false' ]] ; then
python -m pip install "compas$COMPAS_VERSION_SPECIFIER"
fi
python -m pip install --no-cache-dir -e .[dev]
env:
COMPAS_VERSION_SPECIFIER: ${{ matrix.compas-version-specifier }}
- name: Test import
run: python -m compas_mobile_robot_reloc
- name: Test
run: invoke test
- name: Build docs
run: invoke docs
- name: Build package
run: invoke build
ironpython-test:
name: windows-ironpython
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Set up CPython 3.8 (RPC tests)
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies & package for CPython (RPC tests)
run: |
python -m pip install --upgrade pip
pip install wheel # https://stackoverflow.com/questions/34819221
pip install cython
pip install --no-cache-dir .
- name: Install dependencies
run: |
choco install ironpython --version=2.7.8.1
ipy -X:Frames -m ensurepip
curl -o compas.tar.gz -LJO https://pypi.debian.net/compas/latest
ipy -X:Frames -m pip install --no-deps compas.tar.gz
curl -o ironpython-pytest.tar.gz -LJO https://pypi.debian.net/ironpython-pytest/latest
ipy -X:Frames -m pip install --no-deps ironpython-pytest.tar.gz
- name: Test import
run: |
ipy -m compas_mobile_robot_reloc
env:
IRONPYTHONPATH: ./src
- name: Run tests
run: |
ipy tests/ipy_test_runner.py
env:
IRONPYTHONPATH: ./src
publish-docs:
name: Publish docs
needs: build-and-test
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Checkout repo
uses: actions/checkout@v4
- name: Install
run: |
pip install --upgrade pip
pip install wheel # https://stackoverflow.com/questions/34819221
pip install cython
pip install --no-cache-dir -e .[dev]
- name: Build docs
run: invoke docs
- name: Publish docs on branch gh-pages
uses: crazy-max/ghaction-github-pages@c05ee637ec73429400a359430db8e5629f3f2564
with:
target_branch: gh-pages
build_dir: docs
jekyll: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-package:
name: Publish package
needs: build-and-test
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Get version from tag
id: tag_name
run: |
echo ::set-output name=current_version::${GITHUB_REF#refs/tags/v}
- name: Checkout repo
uses: actions/checkout@v4
- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
version: ${{ steps.tag_name.outputs.current_version }}
path: ./CHANGELOG.md
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install
run: |
pip install --upgrade pip
pip install wheel # https://stackoverflow.com/questions/34819221
pip install cython
python -m pip install --no-cache-dir -e .[dev]
- name: Build package
run: invoke build
- name: Upload and release package on PyPi
uses: pypa/[email protected]
if: steps.changelog_reader.outputs.status == 'released'
with:
user: __token__
password: ${{ secrets.pypi_password }}
- name: Create GitHub release and upload assets
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
dist/*.whl
dist/*.tar.gz
body: ${{ steps.changelog_reader.outputs.changes }}
prerelease: ${{ steps.changelog_reader.outputs.status == 'prereleased' }}
draft: ${{ steps.changelog_reader.outputs.status == 'unreleased' }}