-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (64 loc) · 1.96 KB
/
main-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
73
74
75
name: CD
on:
workflow_run:
workflows: CI
types:
- completed
branches:
- main
env:
PYTHON_VERSION: "3.10"
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
makedocs:
name: Deploy API Documentation
runs-on: ubuntu-latest
if: success()
steps:
- name: Get the docs_build artifact
uses: actions/download-artifact@v4
with:
name: docs_final
path: docs_build
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Display structure of docs
run: ls -R docs_build/
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs_build
destination_dir: . # Ensure you deploy to the root of the gh-pages branch
publish_branch: gh-pages
keep_files: false
build-n-publish:
name: Build and publish Python ?? distributions ?? to TestPyPI
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get history and tags for SCM versioning to work
run: |
git fetch --prune --unshallow
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install pypa/build
run: |
python -m pip install build twine
python -m pip install .
- name: Build a binary wheel and a source tarball
run: |
python -m build --sdist --wheel --outdir dist/ .
- name: Check Dist
run: |
python -m twine check dist/*
- name: Upload to Test PyPI
run: |
python -m twine upload -r testpypi -u __token__ -p ${{ secrets.TEST_PYPI_API }} dist/*