-
Notifications
You must be signed in to change notification settings - Fork 11
151 lines (129 loc) · 4.07 KB
/
ci.yaml
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
name: Testing and release
on:
push:
branches:
- main
- development
tags:
# The regex: /^v?((\d+)(\.\d+)*)(-?(a|b|c|rc|alpha|beta)([0-9]+)?)?$
- 'v[0-9].[0-9]+.[0-9]+*'
pull_request:
branches:
- main
- development
jobs:
build_test:
name: Setup, build, and test
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
blender: [2.83, 2.93, 3.3, 3.6]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get target py version
id: python
run: |
pwd
pythonver=$(python ./.github/scripts/blender_pyversion_lookup.py ${{ matrix.blender }})
echo ::set-output name=version::$pythonver
- name: Configure python version
uses: actions/setup-python@v2
with:
python-version: ${{ steps.python.outputs.version }}
- name: Setup python libs
id: pyexe
run: |
python --version
python -m pip install pytest
py_exe_path=$(which python)
echo ::set-output name=path::$py_exe_path
- name: Build and test
run: |
mkdir -p build && cd build;
cmake -DCMAKE_BUILD_TYPE=RELEASE -DGETEIGEN=ON -DGETPYBIND11=ON -DGAMER_TESTS=on -DBUILD_BLENDGAMER=ON -DBLENDER_VERSION_OVERRIDE=${{ matrix.blender }} -DBUILD_PYGAMER=on -DPython_EXECUTABLE:FILEPATH=${{ steps.pyexe.outputs.path }} -DCMAKE_OSX_DEPLOYMENT_TARGET=10.12 ..
cmake --build . --config Release -j 4
ctest -C Release -V -j 4
- name: Get blendgamer filename
id: pkg
run: |
pwd
cd build
zipfile=$(ls *.zip)
echo ::set-output name=filename::$zipfile
- name: Stash blendgamer
# Generate artifacts for all tagged versions
# if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v2
with:
name: ${{ steps.pkg.outputs.filename }}
path: build/*.zip
stage_releases:
name: Stage GitHub Release
runs-on: ubuntu-latest
needs: [build_test]
# Stage release for tagged versions
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- name: Sync artifacts
uses: actions/[email protected]
with:
path: artifacts
- name: Display structure of files
run: ls -R
- name: Collect zipfiles
run: |
mv artifacts/blendgamer*.zip/blendgamer*.zip .
- name: Display structure of downloaded files
run: ls -R
- name: Generate SHA256 checksums
run: sha256sum *.zip > SHA256SUMS.txt
- name: Verify checksums
run: sha256sum -c SHA256SUMS.txt
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref }}
body: If you can read this, we have forgotten to fill in the changelog. Sorry!
draft: true
files: |
./*.zip
./SHA256SUMS.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
deploy_to_pypi:
name: Deploy to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
needs: [build_test]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Update python libs
run: python -m pip install scikit-build pytest
- name: Configures source dist
run: python setup.py sdist
- name: Display structure of files
run: ls -R
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
# - name: Publish package to TestPyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# user: __token__
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
# repository_url: https://test.pypi.org/legacy/