@@ -37,10 +37,10 @@ jobs:
3737 # Only if:
3838 # * Repository is not a fork.
3939 # * Branch is `main` (for workflow_dispatch trigger).
40- if : |
41- github.repository == 'google-parfait/tensorflow-federated'
42- && github.ref == 'refs/heads/main'
43- runs-on : ubuntu-latest
40+ # if: |
41+ # github.repository == 'google-parfait/tensorflow-federated'
42+ # && github.ref == 'refs/heads/main'
43+ runs-on : ubuntu-22.04
4444 timeout-minutes : 5
4545 permissions :
4646 contents : write # Required to create a release.
9797 build-package :
9898 name : Build Package
9999 needs : [publish-release]
100- runs-on : ubuntu-20.04
101- timeout-minutes : 60
100+ strategy :
101+ matrix :
102+ include :
103+ - os : ubuntu-22.04
104+ arch : x86_64
105+ - os : ubuntu-22.04-arm
106+ arch : aarch64
107+ runs-on : ${{ matrix.os }}
108+ timeout-minutes : 360
109+ environment : release
102110 steps :
103111
104112 - name : Checkout repository
@@ -114,11 +122,11 @@ jobs:
114122 create_credentials_file : true
115123
116124 - name : Set up bazel repository cache
117- uses : actions/cache@v4.0.2
125+ uses : actions/cache@v4.2.0
118126 with :
119127 path : " ~/.cache/bazel/"
120- key : ${{ runner.os }}-bazel-${{ hashFiles('.bazelversion', '.bazelrc', 'WORKSPACE') }}
121- restore-keys : ${{ runner.os }}-bazel-
128+ key : ${{ runner.os }}-${{ matrix.arch }}- bazel-${{ hashFiles('.bazelversion', '.bazelrc', 'WORKSPACE') }}
129+ restore-keys : ${{ runner.os }}-${{ matrix.arch }}-bazel
122130
123131 - name : Set up Python
124132@@ -130,26 +138,39 @@ jobs:
130138 run : |
131139 pip install --upgrade "pip"
132140
141+ - name : Install LLVM and Clang
142+ uses : KyleMayes/install-llvm-action@v2
143+ with :
144+ version : " 14.0"
145+
133146 - name : Build Python package
134147 run : |
135148 pip install --upgrade "numpy~=1.25"
136149 bazelisk run //tools/python_package:build_python_package \
137150 --build_tag_filters="-nokokoro,-nopresubmit,-requires-gpu-nvidia" \
138151 --google_credentials="${{ steps.auth.outputs.credentials_file_path }}" \
139- --remote_cache="https://storage.googleapis.com/tensorflow-federated-bazel-cache/${{ github.job }}" \
152+ --remote_cache="https://storage.googleapis.com/${{ vars.BAZEL_CACHE_BUCKET }}/${{ github.job }}" \
153+ --config="linux_${{ matrix.arch }}" \
140154 -- \
141155 --output_dir="${{ github.workspace }}/dist/"
142156
143157 - name : Upload Python package
144158145159 with :
146- name : python-package-distributions
160+ name : python-package-distributions-${{ matrix.arch }}
147161 path : dist/*.whl
148162
149163 test-package :
150164 name : Test Package
151165 needs : [build-package]
152- runs-on : ubuntu-20.04
166+ strategy :
167+ matrix :
168+ include :
169+ - os : ubuntu-22.04
170+ arch : x86_64
171+ - os : ubuntu-22.04-arm
172+ arch : aarch64
173+ runs-on : ${{ matrix.os }}
153174 timeout-minutes : 5
154175 steps :
155176
@@ -161,7 +182,7 @@ jobs:
161182 - name : Download Python package
162183163184 with :
164- name : python-package-distributions
185+ name : python-package-distributions-${{ matrix.arch }}
165186 path : dist/
166187
167188 - name : Set up Python
@@ -190,17 +211,24 @@ jobs:
190211 publish-package :
191212 name : Publish Package
192213 needs : [build-package, test-package]
193- runs-on : ubuntu-latest
214+ runs-on : ubuntu-22.04
194215 timeout-minutes : 5
195216 permissions :
196217 id-token : write # Required for trusted publishing.
218+ environment : release
197219 steps :
198220
199221 - name : Download Python package
200222201223 with :
202- name : python-package-distributions
224+ pattern : python-package-distributions-*
225+ merge-multiple : true
203226 path : dist/
204227
205228 - name : Publish Python package
206229230+ with :
231+ password : ${{ secrets.PYTHON_REPOSITORY_TOKEN }}
232+ repository-url : ${{ vars.PYTHON_REPOSITORY_URL }}
233+ verbose : ' true'
234+ user : ${{ secrets.PYTHON_REPOSITORY_USER }}
0 commit comments