-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (58 loc) · 1.69 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
name: CI/CD
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: self-hosted
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyscaffold
pip install tox
- name: Bump version and push tag
uses: anothrNick/github-tag-action@v1
if: |
contains(github.event.head_commit.message, '#minor') ||
contains(github.event.head_commit.message, '#patch') ||
contains(github.event.head_commit.message, '#major')
with:
github_token: ${{ secrets.GH_TOKEN }}
release_branches: main
DEFAULT_BUMP: patch
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Build the package
run: |
tox
tox -e docs
tox -e build
- name: Publish to PyPI
if: |
contains(github.event.head_commit.message, '#patch') ||
contains(github.event.head_commit.message, '#minor') ||
contains(github.event.head_commit.message, '#major')
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python -m pip install --upgrade twine
twine upload dist/*
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GH_TOKEN }}
publish_dir: ./docs/_build/html