-
Notifications
You must be signed in to change notification settings - Fork 3
143 lines (136 loc) Β· 3.94 KB
/
build.yml
File metadata and controls
143 lines (136 loc) Β· 3.94 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
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
name: Build pipeline
on:
push:
pull_request:
release:
types: [released]
workflow_dispatch:
jobs:
build:
name: π¨ Build distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: π Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: π¨ Build distribution
uses: OctoPrint/actions/build-dist@main
with:
artifact: dist
pre-commit:
name: π§Ή Pre-commit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: π Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: π Set up pre-commit
run: |
pip install pre-commit
- name: π Run pre-commit
run: |
pre-commit run --all-files --show-diff-on-failure
test-install:
name: π§ͺ Installation test
strategy:
fail-fast: false
matrix:
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
runs-on: ubuntu-22.04 # change back to ubuntu-latest once we drop Python 3.7
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: π Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: π Set up test dependencies & run test install
run: |
pip install octoprint
pip install -e .[develop]
test-e2e:
name: π§ͺ E2E tests
needs: build
runs-on: ubuntu-22.04 # change back to ubuntu-latest once we drop Python 3.7 & upgrade playwright
strategy:
fail-fast: false
matrix:
octoprint: ["main", "dev"]
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
exclude:
- octoprint: "dev"
python: "3.7"
- octoprint: "dev"
python: "3.8"
steps:
- name: β¬ Download build result
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: π Run OctoPrint's E2E Tests
uses: OctoPrint/actions/e2e@main
with:
ref: ${{ matrix.octoprint }}
python: ${{ matrix.python }}
deps: ${{ github.workspace }}/dist/*.whl
suffix: "-${{ matrix.octoprint }}-py${{ matrix.python }}"
publish-on-testpypi:
name: π¦ Publish on TestPyPI
if: github.event_name == 'release'
needs:
- build
- pre-commit
- test-install
- test-e2e
runs-on: ubuntu-latest
permissions:
id-token: write
environment:
name: testpypi
url: https://test.pypi.org/p/OctoPrint-FileCheck
steps:
- name: β¬ Download build result
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: π§Ή Remove some stuff that won't make it through twine check
run: |
rm dist/*.source.tar.gz
rm dist/sha512sums.txt
- name: π¦ Publish to index
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
publish-on-pypi:
name: π¦ Publish tagged releases to PyPI
if: github.event_name == 'release'
needs: publish-on-testpypi
runs-on: ubuntu-latest
permissions:
id-token: write
environment:
name: pypi
url: https://pypi.org/p/OctoPrint-FileCheck
steps:
- name: β¬ Download build result
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: π§Ή Remove some stuff that won't make it through twine check
run: |
rm dist/*.source.tar.gz
rm dist/sha512sums.txt
- name: π¦ Publish to index
uses: pypa/gh-action-pypi-publish@release/v1