5
5
pull_request :
6
6
7
7
jobs :
8
+ determine-arm64-runner :
9
+ runs-on : ubuntu-latest
10
+ permissions : read-all
11
+ outputs :
12
+ runner : ${{ steps.set-runner.outputs.runner }}
13
+ steps :
14
+ - name : Determine which runner to use for ARM64 build
15
+ id : set-runner
16
+ run : |
17
+ if [ "${{ github.repository_owner }}" == "deepmodeling" ]; then
18
+ echo "runner=[\"Linux\",\"ARM64\"]" >> $GITHUB_OUTPUT
19
+ else
20
+ echo "runner=\"ubuntu-latest\"" >> $GITHUB_OUTPUT
21
+ fi
22
+
8
23
build_wheels :
9
24
name : Build wheels for cp${{ matrix.python }}-${{ matrix.platform_id }}
25
+ needs : determine-arm64-runner
10
26
runs-on : ${{ matrix.os }}
11
27
strategy :
12
28
fail-fast : false
@@ -33,21 +49,20 @@ jobs:
33
49
platform_id : win_amd64
34
50
dp_variant : cpu
35
51
# linux-aarch64
36
- - os : ubuntu-latest
52
+ - os : ${{ fromJson(needs.determine-arm64-runner.outputs.runner) }}
37
53
python : 310
38
54
platform_id : manylinux_aarch64
39
55
dp_variant : cpu
40
56
steps :
41
- - uses : actions/checkout@v3
57
+ - uses : actions/checkout@v4
42
58
with :
43
- submodules : true
44
59
# https://github.com/pypa/setuptools_scm/issues/480
45
60
fetch-depth : 0
46
- - uses : docker/setup-qemu-action@v2
61
+ - uses : docker/setup-qemu-action@v3
47
62
name : Setup QEMU
48
- if : matrix.platform_id == 'manylinux_aarch64'
63
+ if : matrix.platform_id == 'manylinux_aarch64' && matrix.os == 'ubuntu-latest'
49
64
- name : Build wheels
50
- uses : pypa/cibuildwheel@v2.15
65
+ uses : pypa/cibuildwheel@v2.16
51
66
env :
52
67
CIBW_BUILD_VERBOSITY : 1
53
68
CIBW_ARCHS : all
@@ -60,13 +75,12 @@ jobs:
60
75
name : Build source distribution
61
76
runs-on : ubuntu-latest
62
77
steps :
63
- - uses : actions/checkout@v3
64
- with :
65
- submodules : true
78
+ - uses : actions/checkout@v4
66
79
- uses : actions/setup-python@v4
67
80
name : Install Python
68
81
with :
69
82
python-version : ' 3.11'
83
+ cache : ' pip'
70
84
- run : python -m pip install build
71
85
- name : Build sdist
72
86
run : python -m build --sdist
@@ -94,26 +108,26 @@ jobs:
94
108
needs : [build_wheels]
95
109
runs-on : ubuntu-latest
96
110
steps :
97
- - uses : actions/checkout@v3
111
+ - uses : actions/checkout@v4
98
112
- uses : actions/download-artifact@v3
99
113
with :
100
114
name : artifact
101
115
path : source/install/docker/dist
102
116
- name : Log in to the Container registry
103
- uses : docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc
117
+ uses : docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
104
118
with :
105
119
registry : ghcr.io
106
120
username : ${{ github.actor }}
107
121
password : ${{ secrets.GITHUB_TOKEN }}
108
122
109
123
- name : Extract metadata (tags, labels) for Docker
110
124
id : meta
111
- uses : docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175
125
+ uses : docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934
112
126
with :
113
127
images : ghcr.io/deepmodeling/deepmd-kit
114
128
115
129
- name : Build and push Docker image
116
- uses : docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825
130
+ uses : docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09
117
131
with :
118
132
context : source/install/docker
119
133
push : ${{ github.repository_owner == 'deepmodeling' && github.event_name == 'push' }}
0 commit comments