-
Notifications
You must be signed in to change notification settings - Fork 2
51 lines (48 loc) · 1.82 KB
/
build.yaml
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
name: make build
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v3
# set up python
- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# execute the actual make build process
- name: execute the make build
run: make
# remove moptipy
- name: purge local moptipy installation
run: |
pip uninstall -y moptipy
# attempt to install it again from github
- name: install moptipy from github
run: |
pip install git+https://github.com/thomasWeise/moptipy.git
python -c "import moptipy"
# fix urls in documentation
- name: fix documentation urls
run: |
find /home/runner/work/moptipy/moptipy/docs/build/ \( -type d -name .git -prune \) -o -type f -name "*.html" -print0 | xargs -0 sed -i 's/ href=\"_static\// href=\"\/moptipy\/_static\//g'
find /home/runner/work/moptipy/moptipy/docs/build/ \( -type d -name .git -prune \) -o -type f -name "*.html" -print0 | xargs -0 sed -i 's/ src=\"_static\// src=\"\/moptipy\/_static\//g'
touch /home/runner/work/moptipy/moptipy/docs/build/.nojekyll
# deploy to github pages
- name: deploy documentation
uses: JamesIves/github-pages-deploy-action@a1ea191d508feb8485aceba848389d49f80ca2dc
with:
branch: gh-pages
folder: /home/runner/work/moptipy/moptipy/docs/build/
single-commit: true
# publish to pypi _only_ on release:
- name: publish to pypi
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: |
python3 -m twine upload dist/*.tar.gz dist/*.whl
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TWINE_TOKEN }}