-
Notifications
You must be signed in to change notification settings - Fork 19
83 lines (72 loc) · 2.5 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
name: Continuous Deployment
on:
push:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
test:
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Download the Terminal
run: |
wget --output-document ThetaTerminal.jar https://www.dropbox.com/s/nhre458ha5c7jd5/ThetaTerminal.jar?dl=1
- name: Run the Terminal
run: |
sudo java -jar ThetaTerminal.jar $USERNAME $PASSWORD &
env:
USERNAME: ${{ secrets.TERMINAL_USERNAME }}
PASSWORD: ${{ secrets.TERMINAL_PASSWORD }}
- name: Upgrade pip
run: pip install --upgrade pip
- name: Install dependencies
run: pip install ".[tests]"
- name: Test
run: python -m pytest .
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: pip install ".[docs]"
- name: Build docs
run: mkdocs build
deploy-pypi:
if: startsWith(github.ref, 'refs/tags') # tagged release
needs: [test, build-docs]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build package
run: |
pip install --upgrade build
python -m build
- name: Release to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true
deploy-docs:
if: startsWith(github.ref, 'refs/tags') # tagged release
needs: [test, deploy-pypi]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
# TODO: mhausenblas/mkdocs-deploy-gh-pages@nomaterial does not work with this:
# pip install ".[docs]"
# pip freeze > docs/requirements.txt
# I'll manually list dependencies instead
echo "mkdocs" >> requirements.txt
echo "mkdocstrings[python]" >> requirements.txt
echo "mkdocs-material" >> requirements.txt
- name: Deploy docs
uses: mhausenblas/mkdocs-deploy-gh-pages@master
env:
PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
REQUIREMENTS: docs/requirements.txt