-
Notifications
You must be signed in to change notification settings - Fork 21
105 lines (101 loc) · 3.1 KB
/
release.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
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
name: Release
on:
push:
tags:
- "v*.*.*"
jobs:
create_draft_release:
if: github.ref_type == 'tag'
permissions:
contents: write
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Create draft release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if ! gh release list | grep -q ${{ github.ref_name }}; then
gh release create --title ${{ github.ref_name }} --draft ${{ github.ref_name }}
fi
linux:
name: "x86_64-linux-gnu-{cpu,tpu}"
needs: [create_draft_release]
# We intentionally build on ubuntu 20 to compile against
# an older version of glibc
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: erlef/setup-beam@v1
with:
otp-version: "24"
elixir-version: "1.15.8"
# Setup the compilation environment
- uses: abhinavsingh/setup-bazel@v3
with:
version: "6.5.0"
- uses: actions/setup-python@v2
with:
python-version: "3.9"
- run: python -m pip install --upgrade pip numpy
# Build and upload the archives
- run: mix deps.get
- run: .github/scripts/compile_and_upload.sh ${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
XLA_TARGET: cpu
CC: gcc-9
- run: .github/scripts/compile_and_upload.sh ${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
XLA_TARGET: tpu
CC: gcc-9
macos:
name: "x86_64-darwin-cpu"
needs: [create_draft_release]
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- run: brew install elixir
- run: mix local.hex --force
# Setup the compilation environment
- uses: abhinavsingh/setup-bazel@v3
with:
version: "6.5.0"
- uses: actions/setup-python@v2
with:
python-version: "3.9"
- run: python -m pip install --upgrade pip numpy
# Build and upload the archive
- run: mix deps.get
- run: .github/scripts/compile_and_upload.sh ${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
XLA_TARGET: cpu
CC: gcc-9
macos_arm:
name: "aarch64-darwin-cpu (cross-compiled)"
needs: [create_draft_release]
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- run: brew install elixir
- run: mix local.hex --force
# Setup the compilation environment
- uses: abhinavsingh/setup-bazel@v3
with:
version: "6.5.0"
- uses: actions/setup-python@v2
with:
python-version: "3.9"
- run: python -m pip install --upgrade pip numpy
# Build and upload the archive
- run: mix deps.get
- run: .github/scripts/compile_and_upload.sh ${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
XLA_TARGET: cpu
XLA_TARGET_PLATFORM: "aarch64-darwin"
# Explicitly cross-compile for arm64
BUILD_FLAGS: "--config=macos_arm64"
CC: gcc-9