-
Notifications
You must be signed in to change notification settings - Fork 8
60 lines (55 loc) · 1.85 KB
/
python-publish.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
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
name: Upload Python Package
on:
release:
types: [created]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
export DEBIAN_FRONTEND=noninteractive
# https://github.com/community/community/discussions/47863
sudo apt-mark hold grub-efi-amd64-signed
sudo apt-get update
sudo apt-get upgrade -y --no-install-recommends
sudo apt-get install -y --fix-missing \
nodejs \
libenchant-2-2 \
pandoc \
zip
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements-dev.txt
python3 -m pip install setuptools wheel
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
rm -f archivist/about.py
./scripts/version.sh
python3 -m build --sdist
python3 -m build --wheel
twine check dist/*
twine upload dist/*
- name: Build docs
run: |
./scripts/zipnotebooks.sh
(cd docs && make clean && make html)
- name: Publish docs
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: "./docs/_build/html"
cname: python.datatrails.ai