-
Notifications
You must be signed in to change notification settings - Fork 7
153 lines (124 loc) · 3.9 KB
/
release-pip.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
name: Release - pip package
on:
push:
branches: [ 'release/*' ]
tags: ['v*']
pull_request:
branches: [ 'master', 'release/*' ]
release:
types: [published]
jobs:
# # long running tests and check of image generation
# full_test:
# strategy:
# matrix:
# python-version: ['3.9', '3.10', '3.11', '3.12']
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Set up Python
# uses: actions/setup-python@v5
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install -r requirements.txt
# pip install -r tests/requirements-test.txt
# - name: Run all test with pytest
# run: |
# pytest -k "slow"
# - name: Check images generation for documentation
# run: |
# cd docs/images_generation && ./run.sh
# # test if package generation works and optional package upload to pypi (only on release)
# make_and_upload_package:
# runs-on: ubuntu-latest
# needs: [full_test]
# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0
# - name: Set up Python
# uses: actions/setup-python@v5
# with:
# python-version: '3.11'
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install -r requirements.txt
# - name: Make wheel package and validate it
# run: |
# pip install wheel twine
# # first call to version method would generate VERSION file
# PYTHONPATH=. python pymchelper/run.py --version
# python setup.py bdist_wheel
# twine check dist/*.whl
# # makes source package
# python setup.py sdist
# - name: publish package to pypi
# uses: pypa/[email protected]
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
# with:
# password: ${{ secrets.TWINE_PASSWORD }}
# packages-dir: dist/
# verbose: true
# print-hash: true
generate_docs:
runs-on: ubuntu-latest
# needs: [make_and_upload_package]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # fetch all history, as by default only last 1 commit is fetched
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r docs/requirements.txt
- name: Build Sphinx documentation
run: |
sphinx-apidoc --output-dir docs/apidoc/ pymchelper
sphinx-build --jobs auto docs docs/_build
- name: Upload documentation artifact
uses: actions/upload-artifact@v4
with:
name: sphinx-docs
path: docs/_build
- name: Debug output directory
run: |
find docs/_build -type l
deploy_docs:
runs-on: ubuntu-latest
needs: [generate_docs]
environment:
name: github-pages
permissions:
pages: write
id-token: write
steps:
- name: Download documentation artifact
uses: actions/download-artifact@v4
with:
name: sphinx-docs
path: test
- name: Inspect downloaded files
run: |
ls -l test
- name: Check for symlink
run: |
find test -type l
- name: List recursively all files, including their permissions, including hidden files:
run: |
ls -laR test
- name: List all files (recursively), which miss reading permission for others
run: |
find test -type f ! -perm /o+r
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4
with:
artifact_name: sphinx-docs