55 pull_request :
66
77jobs :
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+
823 build_wheels :
924 name : Build wheels for cp${{ matrix.python }}-${{ matrix.platform_id }}
25+ needs : determine-arm64-runner
1026 runs-on : ${{ matrix.os }}
1127 strategy :
1228 fail-fast : false
@@ -33,21 +49,20 @@ jobs:
3349 platform_id : win_amd64
3450 dp_variant : cpu
3551 # linux-aarch64
36- - os : ubuntu-latest
52+ - os : ${{ fromJson(needs.determine-arm64-runner.outputs.runner) }}
3753 python : 310
3854 platform_id : manylinux_aarch64
3955 dp_variant : cpu
4056 steps :
41- - uses : actions/checkout@v3
57+ - uses : actions/checkout@v4
4258 with :
43- submodules : true
4459 # https://github.com/pypa/setuptools_scm/issues/480
4560 fetch-depth : 0
46- - uses : docker/setup-qemu-action@v2
61+ - uses : docker/setup-qemu-action@v3
4762 name : Setup QEMU
48- if : matrix.platform_id == 'manylinux_aarch64'
63+ if : matrix.platform_id == 'manylinux_aarch64' && matrix.os == 'ubuntu-latest'
4964 - name : Build wheels
50- uses : pypa/cibuildwheel@v2.15
65+ uses : pypa/cibuildwheel@v2.16
5166 env :
5267 CIBW_BUILD_VERBOSITY : 1
5368 CIBW_ARCHS : all
@@ -60,13 +75,12 @@ jobs:
6075 name : Build source distribution
6176 runs-on : ubuntu-latest
6277 steps :
63- - uses : actions/checkout@v3
64- with :
65- submodules : true
78+ - uses : actions/checkout@v4
6679 - uses : actions/setup-python@v4
6780 name : Install Python
6881 with :
6982 python-version : ' 3.11'
83+ cache : ' pip'
7084 - run : python -m pip install build
7185 - name : Build sdist
7286 run : python -m build --sdist
@@ -94,26 +108,26 @@ jobs:
94108 needs : [build_wheels]
95109 runs-on : ubuntu-latest
96110 steps :
97- - uses : actions/checkout@v3
111+ - uses : actions/checkout@v4
98112 - uses : actions/download-artifact@v3
99113 with :
100114 name : artifact
101115 path : source/install/docker/dist
102116 - name : Log in to the Container registry
103- uses : docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc
117+ uses : docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
104118 with :
105119 registry : ghcr.io
106120 username : ${{ github.actor }}
107121 password : ${{ secrets.GITHUB_TOKEN }}
108122
109123 - name : Extract metadata (tags, labels) for Docker
110124 id : meta
111- uses : docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175
125+ uses : docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934
112126 with :
113127 images : ghcr.io/deepmodeling/deepmd-kit
114128
115129 - name : Build and push Docker image
116- uses : docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825
130+ uses : docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09
117131 with :
118132 context : source/install/docker
119133 push : ${{ github.repository_owner == 'deepmodeling' && github.event_name == 'push' }}
0 commit comments