-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (57 loc) · 1.76 KB
/
ci-cd.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
name: ci-cd
on: [push, pull_request]
jobs:
ci:
runs-on: ubuntu-latest
# define job steps
steps:
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Check-out Repository
uses: actions/checkout@v2
- name: Install poetry
run: |
pip install poetry
poetry --version
- name: Install package
run: poetry install
- name: Build documentation
run: poetry run make html --directory docs/
cd:
permissions:
id-token: write
contents: write
# only runs if the "ci" job is successful
needs: ci
# only runs if new work is pushed to the main branch
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
# setups os
runs-on: ubuntu-latest
# define job steps
steps:
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Check-out Repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Python Semantic Release to prepare a new release
id: release
uses: python-semantic-release/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: steps.release.outputs.released == 'true'
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
- name: Publish package distributions to Github Releases
uses: python-semantic-release/upload-to-gh-release@main
if: steps.release.outputs.released == 'true'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}