forked from iqm-finland/iqm-client
-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (92 loc) · 2.91 KB
/
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Upload package to PyPI and publish documentation
on:
release:
types: [published]
workflow_dispatch:
workflow_call:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"
- name: Install dependencies
run: uv pip install --constraint requirements.txt --editable .[cicd]
- name: Build distribution
run: uv build
- name: Store distribution packages
uses: actions/upload-artifact@v4
with:
name: dist
path: ./dist
push_to_pypi:
runs-on: ubuntu-latest
needs:
- build
environment:
name: pypi
url: https://pypi.org/p/iqm-client
permissions:
id-token: write
steps:
- name: Download distribution packages
uses: actions/download-artifact@v4
- name: Publish distribution packages to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
attestations: false
publish_docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"
- name: Checkout latest tagged commit
run: |
git checkout $(git describe --tags --abbrev=0)
- name: Install dependencies
run: |
uv pip install --constraint requirements.txt --editable .[cicd,docs]
sudo apt-get install graphviz
- name: Build docs
run: |
./docbuild
touch build/sphinx/html/.nojekyll # allow underscores in URL path
# remove unnecessary build files
sudo rm -rf build/sphinx/html/.doctrees
- name: Publish to gh-pages
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: build/sphinx/html
force: false
gen_licenses_info:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"
- name: Install dependencies
run: uv pip install --constraint requirements.txt --editable .[cicd]
- name: Generate license information for dependencies
run: |
pip-licenses --format=confluence --with-urls > licenses.txt
cat -n licenses.txt | sort -uk2 | sort -n | cut -f2- > tmp && mv tmp licenses.txt # remove duplicate lines
- name: Upload license information artifact
uses: actions/upload-artifact@v4
with:
name: dependencies-licenses
path: licenses.txt