-
Notifications
You must be signed in to change notification settings - Fork 5
124 lines (109 loc) · 3.25 KB
/
Copy pathdeploy.yaml
File metadata and controls
124 lines (109 loc) · 3.25 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
name: Build and upload to PyPI
on:
push:
tags:
- "*"
release:
types:
- published
concurrency:
group: "${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}"
cancel-in-progress: true
defaults:
run:
shell: bash -l {0}
jobs:
build_wheels:
if: "github.repository == 'MDAnalysis/pytng'"
name: Build wheels
runs-on: ${{ matrix.buildplat[0] }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
buildplat:
- [ubuntu-22.04, manylinux_x86_64, x86_64]
- [macos-13, macosx_*, x86_64]
- [windows-2022, win_amd64, AMD64]
- [macos-14, macosx_*, arm64]
python: ["cp311", "cp312", "cp313", "cp314"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build wheels
uses: pypa/cibuildwheel@v3.2.1
env:
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
CIBW_ARCHS: ${{ matrix.buildplat[2] }}
CIBW_BUILD_VERBOSITY: 1
- name: upload artifacts
if: |
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) ||
(github.event_name == 'release' && github.event.action == 'published')
uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.buildplat[0] }}-${{ matrix.python }}
path: wheelhouse/*.whl
retention-days: 7
build_sdist:
if: "github.repository == 'MDAnalysis/pytng'"
name: build package source distribution
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build sdist
run: pipx run build --sdist
- name: upload artifacts
if: |
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) ||
(github.event_name == 'release' && github.event.action == 'published')
uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
retention-days: 7
upload_testpypi:
if: |
github.repository == 'MDAnalysis/pytng' &&
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))
name: testpypi upload
environment:
name: deploy
url: https://test.pypi.org/p/pytng
permissions:
id-token: write
runs-on: ubuntu-latest
needs: [build_wheels, build_sdist]
steps:
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: upload_source_and_wheels
uses: pypa/gh-action-pypi-publish@v1.13.0
with:
skip_existing: true
repository_url: https://test.pypi.org/legacy/
upload_pypi:
if: |
github.repository == 'MDAnalysis/pytng' &&
github.event_name == 'release' && github.event.action == 'published'
name: pypi upload
environment:
name: deploy
url: https://pypi.org/p/pytng
permissions:
id-token: write
runs-on: ubuntu-latest
needs: [build_wheels, build_sdist]
steps:
- uses: actions/download-artifact@v4.1.7
with:
path: dist
merge-multiple: true
- name: upload_source_and_wheels
uses: pypa/gh-action-pypi-publish@v1.13.0