Skip to content

Commit b442ded

Browse files
committed
Update build script.
1 parent a71323d commit b442ded

File tree

9 files changed

+241
-229
lines changed

9 files changed

+241
-229
lines changed

.github/workflows/macos.yml

Lines changed: 23 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,28 @@ on:
99
tags:
1010
- v*
1111

12-
env:
13-
BUILD_TYPE: Release
14-
GNU_CC: /usr/local/bin/gcc-9
15-
GNU_CXX: /usr/local/bin/g++-9
16-
LLVM_CC: /usr/local/opt/llvm/bin/clang
17-
LLVM_CXX: /usr/local/opt/llvm/bin/clang++
18-
1912
jobs:
2013
macos:
2114
runs-on: macos-latest
2215

2316
strategy:
2417
matrix:
25-
compiler: [clang]
26-
# compiler: [gcc, clang]
18+
python-version-major: [3]
19+
python-version-minor: [8, 9, 10, 11, 12]
20+
21+
env:
22+
BUILD_TYPE: Release
23+
python-version: ${{ format('{0}.{1}', matrix.python-version-major, matrix.python-version-minor) }}
2724

2825
steps:
29-
- uses: actions/checkout@v2
26+
- uses: actions/checkout@v4
3027
with:
3128
submodules: true
3229

3330
- name: Set up Python version
34-
uses: actions/setup-python@v2
31+
uses: actions/setup-python@v4
3532
with:
36-
python-version: 3.9
33+
python-version: ${{ env.python-version }}
3734

3835
- name: Install Poetry
3936
run: |
@@ -50,20 +47,6 @@ jobs:
5047
restore-keys: |
5148
${{ runner.os }}-poetry-${{ hashFiles('**/pyproject.toml') }}
5249
53-
- name: Install GNU C/C++ compiler
54-
if: ${{ matrix.compiler == 'gcc' }}
55-
run: |
56-
brew install gcc@9
57-
export GNU_CC=gcc-9
58-
export GNU_CXX=g++-9
59-
60-
- name: Install LLVM Clang
61-
if: ${{ matrix.compiler == 'clang' }}
62-
run: |
63-
brew install llvm
64-
export LLVM_CC=clang-10
65-
export LLVM_CXX=clang++-10
66-
6750
- name: Install Google Test
6851
env:
6952
C_COMPILER: ${{ matrix.compiler }}
@@ -73,20 +56,7 @@ jobs:
7356
mkdir build
7457
cd build
7558
76-
if [ "$C_COMPILER" = "gcc" ]; then
77-
cmake .. \
78-
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
79-
-DCMAKE_C_COMPILER=$GNU_CC \
80-
-DCMAKE_CXX_COMPILER=$GNU_CXX
81-
fi
82-
83-
if [ "$C_COMPILER" = "clang" ]; then
84-
cmake .. \
85-
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
86-
-DCMAKE_C_COMPILER=$LLVM_CC \
87-
-DCMAKE_CXX_COMPILER=$LLVM_CXX
88-
fi
89-
59+
cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE
9060
cmake --build . --config $BUILD_TYPE --parallel 2
9161
cmake --build . --target install
9262
@@ -97,23 +67,10 @@ jobs:
9767
cmake -E make_directory ${{runner.workspace}}/build
9868
cd ${{runner.workspace}}/build
9969
100-
if [ "$C_COMPILER" = "gcc" ]; then
101-
cmake $GITHUB_WORKSPACE \
102-
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
103-
-DCMAKE_C_COMPILER=$GNU_CC \
104-
-DCMAKE_CXX_COMPILER=$GNU_CXX \
105-
-DBUILD_EXAMPLES=ON \
106-
-DBUILD_TESTS=ON
107-
fi
108-
109-
if [ "$C_COMPILER" = "clang" ]; then
110-
cmake $GITHUB_WORKSPACE \
111-
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
112-
-DCMAKE_C_COMPILER=$LLVM_CC \
113-
-DCMAKE_CXX_COMPILER=$LLVM_CXX \
114-
-DBUILD_EXAMPLES=ON \
115-
-DBUILD_TESTS=ON
116-
fi
70+
cmake $GITHUB_WORKSPACE \
71+
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
72+
-DBUILD_EXAMPLES=ON \
73+
-DBUILD_TESTS=ON
11774
11875
cmake --build . --config $BUILD_TYPE --parallel 2
11976
@@ -125,8 +82,17 @@ jobs:
12582
- name: Install Python modules
12683
if: steps.pipenv-cache.outputs.cache-hit != 'true'
12784
run: |
85+
poetry build -f wheel
12886
poetry install
12987
13088
- name: Python module test
13189
run: |
13290
poetry run pytest -s tests
91+
92+
- name: Create release
93+
if: startsWith(github.ref, 'refs/tags/')
94+
uses: softprops/action-gh-release@v1
95+
with:
96+
files: ./dist/*.whl
97+
draft: false
98+
prerelease: false

.github/workflows/ubuntu.yml

Lines changed: 25 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,28 @@ on:
99
tags:
1010
- v*
1111

12-
env:
13-
BUILD_TYPE: Release
14-
GNU_CC: gcc-9
15-
GNU_CXX: g++-9
16-
LLVM_CC: clang-11
17-
LLVM_CXX: clang++-11
18-
1912
jobs:
2013
ubuntu:
2114
runs-on: ubuntu-latest
2215

2316
strategy:
2417
matrix:
25-
compiler: [gcc, clang]
18+
python-version-major: [3]
19+
python-version-minor: [8, 9, 10, 11, 12]
20+
21+
env:
22+
BUILD_TYPE: Release
23+
python-version: ${{ format('{0}.{1}', matrix.python-version-major, matrix.python-version-minor) }}
2624

2725
steps:
28-
- uses: actions/checkout@v2
26+
- uses: actions/checkout@v4
2927
with:
3028
submodules: true
3129

3230
- name: Set up Python version
33-
uses: actions/setup-python@v2
31+
uses: actions/setup-python@v4
3432
with:
35-
python-version: 3.9
33+
python-version: ${{ env.python-version }}
3634

3735
- name: Install Poetry
3836
run: |
@@ -50,18 +48,10 @@ jobs:
5048
${{ runner.os }}-poetry-${{ hashFiles('**/pyproject.toml') }}
5149
5250
- name: Install GNU C/C++ compiler
53-
if: ${{ matrix.compiler == 'gcc' }}
5451
run: |
5552
sudo apt-get install -y gcc-9 g++-9
56-
export GNU_CC=gcc-9
57-
export GNU_CXX=g++-9
58-
59-
- name: Install LLVM Clang
60-
if: ${{ matrix.compiler == 'clang' }}
61-
run: |
62-
sudo apt-get install -y clang-11 clang++-11
63-
export LLVM_CC=clang-11
64-
export LLVM_CXX=clang++-11
53+
export CC=gcc-9
54+
export CXX=g++-9
6555
6656
- name: Install Google Test
6757
env:
@@ -72,20 +62,7 @@ jobs:
7262
mkdir build
7363
cd build
7464
75-
if [ "$C_COMPILER" = "gcc" ]; then
76-
cmake .. \
77-
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
78-
-DCMAKE_C_COMPILER=$GNU_CC \
79-
-DCMAKE_CXX_COMPILER=$GNU_CXX
80-
fi
81-
82-
if [ "$C_COMPILER" = "clang" ]; then
83-
cmake .. \
84-
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
85-
-DCMAKE_C_COMPILER=$LLVM_CC \
86-
-DCMAKE_CXX_COMPILER=$LLVM_CXX
87-
fi
88-
65+
cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE
8966
cmake --build . --config $BUILD_TYPE --parallel 2
9067
sudo cmake --build . --target install
9168
@@ -96,23 +73,10 @@ jobs:
9673
cmake -E make_directory ${{runner.workspace}}/build
9774
cd ${{runner.workspace}}/build
9875
99-
if [ "$C_COMPILER" = "gcc" ]; then
100-
cmake $GITHUB_WORKSPACE \
101-
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
102-
-DCMAKE_C_COMPILER=$GNU_CC \
103-
-DCMAKE_CXX_COMPILER=$GNU_CXX \
104-
-DBUILD_EXAMPLES=ON \
105-
-DBUILD_TESTS=ON
106-
fi
107-
108-
if [ "$C_COMPILER" = "clang" ]; then
109-
cmake $GITHUB_WORKSPACE \
110-
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
111-
-DCMAKE_C_COMPILER=$LLVM_CC \
112-
-DCMAKE_CXX_COMPILER=$LLVM_CXX \
113-
-DBUILD_EXAMPLES=ON \
114-
-DBUILD_TESTS=ON
115-
fi
76+
cmake $GITHUB_WORKSPACE \
77+
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
78+
-DBUILD_EXAMPLES=ON \
79+
-DBUILD_TESTS=ON
11680
11781
cmake --build . --config $BUILD_TYPE --parallel 2
11882
@@ -124,8 +88,17 @@ jobs:
12488
- name: Install Python modules
12589
if: steps.pipenv-cache.outputs.cache-hit != 'true'
12690
run: |
91+
poetry build -f wheel
12792
poetry install
12893
12994
- name: Python module test
13095
run: |
13196
poetry run pytest -s tests
97+
98+
- name: Create release
99+
if: startsWith(github.ref, 'refs/tags/')
100+
uses: softprops/action-gh-release@v1
101+
with:
102+
files: ./dist/*.whl
103+
draft: false
104+
prerelease: false

.github/workflows/windows.yml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,28 @@ on:
99
tags:
1010
- v*
1111

12-
env:
13-
BUILD_TYPE: Release
14-
1512
jobs:
1613
windows:
1714
runs-on: windows-latest
15+
16+
strategy:
17+
matrix:
18+
python-version-major: [3]
19+
python-version-minor: [8, 9, 10, 11, 12]
20+
21+
env:
22+
BUILD_TYPE: Release
23+
python-version: ${{ format('{0}.{1}', matrix.python-version-major, matrix.python-version-minor) }}
24+
1825
steps:
19-
- uses: actions/checkout@v2
26+
- uses: actions/checkout@v4
2027
with:
2128
submodules: true
2229

2330
- name: Set up Python version
24-
uses: actions/setup-python@v2
31+
uses: actions/setup-python@v4
2532
with:
26-
python-version: 3.9
33+
python-version: ${{ env.python-version }}
2734

2835
- name: Install Poetry
2936
run: |
@@ -72,8 +79,17 @@ jobs:
7279
- name: Install Python modules
7380
if: steps.pipenv-cache.outputs.cache-hit != 'true'
7481
run: |
82+
poetry build -f wheel
7583
poetry install
7684
7785
- name: Python module test
7886
run: |
7987
poetry run pytest -s tests
88+
89+
- name: Create release
90+
if: startsWith(github.ref, 'refs/tags/')
91+
uses: softprops/action-gh-release@v1
92+
with:
93+
files: ./dist/*.whl
94+
draft: false
95+
prerelease: false

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
v0.2.4
2+
---
3+
* Update CI scripts to build wheels for 5 latest Python versions.
4+
5+
16
v0.2.3
27
---
38
* Update some method names (e.g., `isStatic` -> `isLocked`)

build.py

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)