-
Notifications
You must be signed in to change notification settings - Fork 2
50 lines (48 loc) · 1.33 KB
/
linux.yml
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
# Action name
name: Release for Linux
on:
push:
tags:
- 'v[0-9]+\.[0-9]+\.[0-9]+'
jobs:
release:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- name: Cancel previous run
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Build
run: |
pip install -r requirements.txt
bazel build --config=linux --remote_cache=http://${{ secrets.BAZEL_CACHE }}:8080 @jax_xc_repo//:jax_xc_wheel
- name: Test the wheel
run: |
pip install $(ls bazel-bin/external/jax_xc_repo/*.whl)
python3 tests/test_wheel.py
- name: Upload artifact
uses: actions/upload-artifact@main
with:
name: linux_wheel
path: bazel-bin/external/jax_xc_repo/*.whl
publish:
runs-on: ubuntu-latest
needs: release
steps:
- name: Download artifact
uses: actions/download-artifact@main
with:
name: linux_wheel
path: dist
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}