-
Notifications
You must be signed in to change notification settings - Fork 105
109 lines (97 loc) · 2.85 KB
/
release.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
name: Release
on:
release:
types: [published, edited]
jobs:
build_sdist:
name: Build Source Distribution
runs-on: "ubuntu-latest"
steps:
- name: Checkout anaStruct Repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
- name: Install dependencies
run: |
python -m pip install --upgrade poetry
poetry install
- name: Build Source Distribution
run: poetry build -f sdist
- name: Upload Source Distribution
uses: actions/upload-artifact@v4
with:
name: sdist
path: ./dist/*.tar.gz
build_wheels:
name: Build wheels on ${{ matrix.python }}-${{ matrix.buildplat[1] }}
needs: build_sdist
runs-on: ${{ matrix.buildplat[0] }}
strategy:
fail-fast: false
matrix:
buildplat:
- [ubuntu-latest, manylinux_x86_64]
- [ubuntu-latest, musllinux_x86_64]
- [macos-13, macosx_x86_64]
- [macos-14, macosx_arm64]
- [windows-latest, win_amd64]
python: ["cp310", "cp311", "cp312"]
steps:
- name: Checkout anaStruct Repository
uses: actions/checkout@v4
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: "${{ matrix.python }}-${{ matrix.buildplat[1] }}"
with:
output-dir: dist
- uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.python }}-${{ matrix.buildplat[1] }}
path: ./dist/*.whl
run_tests:
name: Fully Test Release Package with Release Dependencies
needs: build_sdist
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade poetry
poetry install
- name: Run linting check with pylint
run: |
poetry run pylint ./anastruct
- name: Run formatting checks with black
run: |
poetry run black --check .
- name: Run type checks with mypy
run: |
poetry run mypy
- name: Run FEM tests with pytest
run: |
poetry run pytest --pspec tests/
publish:
name: Publish to PyPI
needs:
- build_sdist
- build_wheels
- run_tests
runs-on: "ubuntu-latest"
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: dist/
- name: Publish to pypi
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASS }}