-
Notifications
You must be signed in to change notification settings - Fork 28
67 lines (65 loc) · 1.93 KB
/
publish.yaml
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
name: Upload Python Package
on:
release:
types: [published]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: cache poetry install
uses: actions/cache@v2
with:
path: ~/.local
key: poetry-1.4.2-0
- name: setup poetry
uses: snok/install-poetry@v1
with:
poetry-version: 1.4.2
virtualenvs-create: true
virtualenvs-in-project: true
- name: cache deps
id: cache-deps
uses: actions/cache@v2
with:
path: .venv
key: pydeps-${{ hashFiles('**/poetry.lock') }}
- name: build and publish pypi
env:
PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: |
poetry config pypi-token.pypi $PYPI_TOKEN
poetry version ${{ github.ref_name }}
poetry publish --build
poetry install --no-interaction --no-root
poetry run jake ddt --output-format json -o bom.json --whitelist whitelist.json
- name: update version
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Automatic version bump
branch: main
file_pattern: pyproject.toml
- name: build docs
run: |
mkdir gh-pages
touch gh-pages/.nojekyll
cd docs
poetry install --no-interaction
poetry run make clean html
cp -r _build/html/* ../gh-pages/
- name: publish docs
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: gh-pages
- name: sbom
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: bom.json
asset_name: bom.json
tag: ${{ github.ref }}