-
Notifications
You must be signed in to change notification settings - Fork 591
146 lines (140 loc) · 3.91 KB
/
release.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
name: Release Trimesh
on:
push:
branches:
- main
- release-candidate
jobs:
formatting:
name: Check Code Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install Formatting
run: |
pip install ruff
- name: Check Formatting
run: ruff check .
tests:
name: Run Unit Tests
needs: formatting
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-latest, macos-latest, windows-latest]
exclude:
# windows runners have gotten flaky
- os: windows-latest
python-version: 3.8
- os: windows-latest
python-version: 3.9
- os: macos-latest
python-version: 3.9
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Test a minimal install
run: |
pip install .
python tests/test_minimal.py
- name: Install Trimesh
run: pip install .[easy,test]
- name: Run Pytest
run: pytest tests/
pypi:
name: Release To PyPi
needs: [tests, containers]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install publishing dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
pyproject-build --outdir dist .
twine upload dist/*
containers:
name: Build Docker Images
runs-on: ubuntu-latest
steps:
- name: Log In to Docker Hub
run: echo ${{ secrets.DH_PASS }} | docker login --username mikedh --password-stdin
- name: Checkout trimesh
uses: actions/checkout@v3
- name: Build Images And Docs
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
make tests # build docker images and run unit tests
make publish-docker # push images to docker hub
make docs # build sphinx docs
- name: Deploy Github Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./html
force_orphan: true
- name: Logout of registries
if: always()
run: |
docker logout
corpus:
runs-on: ubuntu-latest
name: Check Corpus Loading
steps:
- uses: actions/checkout@v3
- name: Trimesh DiskCache
id: cache-resolvers
uses: actions/cache@v3
with:
path: ~/.trimesh-cache
key: trimesh-cache
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install Trimesh
run: pip install .[easy,test]
- name: Run Corpus Check
run: python tests/corpus.py
release:
permissions:
contents: write # for actions/create-release
name: Create GitHub Release
needs: [tests, containers]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Tag Version
id: set_tag
run: |
export VER=$(python trimesh/version.py)
echo "::set-output name=tag_name::${VER}"
- name: Create Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.set_tag.outputs.tag_name }}
release_name: Release ${{ steps.set_tag.outputs.tag_name }}
draft: false
prerelease: false