-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (59 loc) · 1.76 KB
/
ci-cd.yml
File metadata and controls
64 lines (59 loc) · 1.76 KB
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
# This is a basic workflow to help you get started with Actions
name: CI-CD
on:
#workflow_dispatch
push:
branches:
- main
pull_request:
branches:
- main
jobs:
ci:
# Step 1. Set up operating system
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build --user
pip install flake8 black wheel twine setuptools
pip install .
pip install -r requirements-dev.txt
- name: build a binary wheel & source tarball
run: |
python -m build --sdist --wheel --outdir dist/ .
- name: build the documentation
run: sphinx-build -b html docs/source/ docs/build/html
cd:
#only run this job if the "ci" job passes
needs: ci
# Only run this job if new work is pushed to "main"
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
# Step 1. Set up operating system
runs-on: ubuntu-latest
steps:
# Step 2. Set up Python 3.x
- uses: actions/setup-python@v2
with:
python-version: '3.8'
# Step 3. Check-out repository so we can access its contents
- uses: actions/checkout@v2
with:
fetch-depth: 0
# Step 4. upgrade pip
- name: upgrade pip
run:
python -m pip install --upgrade pip
# Step 4. Use PSR to make release
- name: Python Semantic Release
uses: relekang/python-semantic-release@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
repository_username: __token__
repository_password: ${{ secrets.PYPI_PASSWORD }}