-
Notifications
You must be signed in to change notification settings - Fork 24
130 lines (114 loc) · 3.43 KB
/
Copy pathrelease.yaml
File metadata and controls
130 lines (114 loc) · 3.43 KB
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
name: Release
on:
release:
types: [published, edited]
jobs:
build_sdist:
name: Build Source Distribution
runs-on: "ubuntu-latest"
steps:
- name: Checkout pyCUFSM Repository
uses: actions/checkout@v7
- name: Install Poetry
run: pipx install poetry
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: "poetry"
- name: Install dependencies
run: |
poetry install
- name: Build Source Distribution
run: poetry build -f sdist
- name: Upload Source Distribution
uses: actions/upload-artifact@v7
with:
name: cibw-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, x86_64]
- [ubuntu-latest, manylinux_aarch64, aarch64]
- [ubuntu-latest, musllinux_x86_64, x86_64]
- [macos-15-intel, macosx_x86_64, x86_64]
- [macos-latest, macosx_arm64, arm64]
- [windows-latest, win_amd64, AMD64]
python: ["cp310", "cp311", "cp312", "cp313", "cp314"]
steps:
- name: Set up QEMU for aarch64
if: matrix.buildplat[2] == 'aarch64'
uses: docker/setup-qemu-action@v4
with:
platforms: arm64
- name: Checkout pyCUFSM Repository
uses: actions/checkout@v7
- name: Build wheels
uses: pypa/cibuildwheel@v4.1.0
env:
CIBW_BUILD: "${{ matrix.python }}-${{ matrix.buildplat[1] }}"
CIBW_ARCHS: "${{ matrix.buildplat[2] }}"
with:
output-dir: dist
- uses: actions/upload-artifact@v7
with:
name: cibw-wheels-${{ 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@v7
- name: Install Poetry
run: pipx install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Install dependencies
run: |
poetry install
- name: Run linting check with pylint
run: |
poetry run pylint ./pycufsm
- 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@v8
with:
pattern: cibw-*
path: dist
merge-multiple: true
- name: Display our files
run: ls dist
- name: Publish to pypi
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASS }}