Skip to content

Commit 4622a9a

Browse files
committed
ci: switch to custom build action
1 parent f50f43b commit 4622a9a

File tree

1 file changed

+33
-14
lines changed

1 file changed

+33
-14
lines changed

.github/workflows/build.yml

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,10 @@ jobs:
1717
uses: actions/setup-python@v5
1818
with:
1919
python-version: "3.10"
20-
- name: 🏗 Install build dependencies
21-
run: >-
22-
python -m pip install wheel build twine --user
23-
- name: 🔨 Build a binary wheel and a source tarball
24-
run: >-
25-
python -m build
26-
- name: 🧪 Check that twine is happy with it
27-
run: >-
28-
twine check --strict dist/*
29-
- name: ⬆ Upload build result
30-
uses: actions/upload-artifact@v4
20+
- name: 🔨 Build distribution
21+
uses: OctoPrint/actions/build-dist@main
3122
with:
32-
name: dist
33-
path: dist
23+
artifact: dist
3424

3525
pre-commit:
3626
name: 🧹 Pre-commit
@@ -67,7 +57,28 @@ jobs:
6757
pip install -e .[develop]
6858
- name: 🚀 Run test suite
6959
run: |
70-
pytest
60+
pytest | tee report.txt
61+
62+
# generate summary
63+
python=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:3])))')
64+
today=$(date +'%Y-%m-%d')
65+
now=$(date +'%H:%M')
66+
summary=$(tail -n1 report.txt | sed 's/^=*\s//g' | sed 's/\s=*$//g')
67+
68+
cat << EOF >> $GITHUB_STEP_SUMMARY
69+
### Test Report
70+
71+
*generated on $today at $now under Python $python*
72+
73+
<details>
74+
<summary>$summary</summary>
75+
76+
\`\`\`
77+
$(cat report.txt)
78+
\`\`\`
79+
80+
</details>
81+
EOF
7182
7283
test-install:
7384
name: 🧪 Installation test
@@ -137,6 +148,10 @@ jobs:
137148
with:
138149
name: dist
139150
path: dist
151+
- name: 🧹 Remove some stuff that won't make it through twine check
152+
run: |
153+
rm dist/*.source.tar.gz
154+
rm dist/sha512sums.txt
140155
- name: 📦 Publish to index
141156
uses: pypa/gh-action-pypi-publish@release/v1
142157
with:
@@ -158,5 +173,9 @@ jobs:
158173
with:
159174
name: dist
160175
path: dist
176+
- name: 🧹 Remove some stuff that won't make it through twine check
177+
run: |
178+
rm dist/*.source.tar.gz
179+
rm dist/sha512sums.txt
161180
- name: 📦 Publish to index
162181
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)