-
Notifications
You must be signed in to change notification settings - Fork 4
76 lines (62 loc) · 2.1 KB
/
Copy pathrelease.yml
File metadata and controls
76 lines (62 loc) · 2.1 KB
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
name: Release
on:
release:
types: [published]
permissions:
contents: read
jobs:
test:
name: Test Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: requirements-test.txt
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --editable . --requirement requirements-test.txt
- name: Verify release version
run: |
package_version="$(python -c 'import docx; print(docx.__version__)')"
tag_version="${GITHUB_REF_NAME#v}"
test "$package_version" = "$tag_version"
- name: Run unit and integration tests
run: python -m pytest -q
- name: Run acceptance tests
run: python -m behave --format progress --stop --tags=-wip
package:
name: Verify release distributions
needs: test
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Build distributions
run: |
python -m pip install --upgrade build twine
python -m build
release_version="${GITHUB_REF_NAME#v}"
python -m twine check \
"dist/python_docx_oss-${release_version}-py3-none-any.whl" \
"dist/python_docx_oss-${release_version}.tar.gz"
- name: Install and verify distribution
run: |
tag_version="${GITHUB_REF_NAME#v}"
python -m pip install --force-reinstall \
"dist/python_docx_oss-${tag_version}-py3-none-any.whl"
package_version="$(python -c 'import docx; print(docx.__version__)')"
test "$package_version" = "$tag_version"