-
Notifications
You must be signed in to change notification settings - Fork 5
62 lines (52 loc) · 1.9 KB
/
releasing.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
name: Release and publish
on:
push:
branches:
- main
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools setuptools_scm wheel
pip install numpy
pip install -e .
pip install -e .[tests]
- name: Test
run: |
pytest tests/test_generator.py # test generator
pytest --mpl tests/test_plotter.py # test plots
# pytest --mpl-generate-path=tests/data_gaas/remote_baseline tests/test_plotter.py # generate output plots
# to run the following image comparison tests and see relative differences, use the CLI
# pytest --mpl --mpl-generate-summary=html tests/test_plotter.py
- name: Build packages
run: |
python setup.py sdist bdist_wheel
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Generate release info
run: |
awk 'BEGIN {p = 0} {a = 0 }; /^v\d*.\d*.\d*./ { p += 1; a = 1}; p + a == 1 { print } ' CHANGELOG.rst | sed -e '1,1d' | sed -e '/./,$!d' -e :a -e '/^\n*$/{$d;N;ba' -e '}' > release_info.txt
echo "version=$(grep version setup.py | awk -F\" '{print $2}')" >> $GITHUB_ENV
- name: Release
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.version }}
release_name: ${{ env.version }}
body_path: release_info.txt
draft: false
prerelease: false