-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (77 loc) · 2.93 KB
/
release.yaml
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
name: Release OpenCLC Binary
on: push
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- target: x86_64-linux-musl
mcpu: x86_64
- target: x86_64-windows-gnu
mcpu: x86_64
- target: aarch64-macos
mcpu: generic
- target: x86_64-macos
mcpu: x86_64
steps:
- uses: actions/checkout@v4
- name: Load Zig from Cache
id: zvm-zig-cache
uses: actions/cache/restore@v3
with:
path: /home/runner/.zvm
key: zvm-zig-13
- name: Install ZVM and Zig
if: '!steps.zvm-zig-cache.outputs.cache-hit'
run: |
wget https://github.com/tristanisham/zvm/releases/download/v0.7.3/zvm-linux-amd64.tar -O zvm.tar
mkdir -p /home/runner/.zvm/self
tar -xf zvm.tar -C /home/runner/.zvm/self
rm zvm.tar
/home/runner/.zvm/self/zvm i 0.13.0
- name: Save ZVM and Zig to Cache
if: '!steps.zvm-zig-cache.outputs.cache-hit'
uses: actions/cache/save@v3
with:
path: /home/runner/.zvm
key: zvm-zig-13
- name: Load Cache
id: llvm-build-cache
uses: actions/cache/restore@v3
with:
path: ${{ github.workspace }}/out/${{ matrix.target }}-${{ matrix.mcpu }}
key: build-deps-${{ matrix.target }}-${{ matrix.mcpu }}
# no caching for apt, but these tools are only needed for openclc dependencies
# only install if the build-deps cache misses
- name: Install APT Dependencies
if: '!steps.llvm-build-cache.outputs.cache-hit'
run: |
chmod +x ./llvm.sh
sudo ./llvm.sh 18 all
sudo apt install ninja-build
- name: Build LLVM and Dependencies
if: '!steps.llvm-build-cache.outputs.cache-hit'
run: |
chmod +x ${{ github.workspace }}/build-deps.sh
${{ github.workspace }}/build-deps.sh ${{ matrix.target }} ${{ matrix.mcpu }}
- name: Save to Cache
if: '!steps.llvm-build-cache.outputs.cache-hit'
uses: actions/cache/save@v3
with:
path: ${{ github.workspace }}/out/${{ matrix.target }}-${{ matrix.mcpu }}
key: build-deps-${{ matrix.target }}-${{ matrix.mcpu }}
- name: Build OpenCLC
run: |
chmod +x build-openclc.sh
if [ ${{ matrix.target }} = "x86_64-windows-gnu" ]; then
echo "OpenCLC doesn't build for windows, use llvm-spirv.exe" > ${{ github.workspace }}/out/${{ matrix.target }}-${{ matrix.mcpu }}/bin/openclc.exe
else
./build-openclc.sh ${{ matrix.target }} ${{ matrix.mcpu }} Release
fi
./release.sh ${{ matrix.target }} ${{ matrix.mcpu }}
- name: Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: "release/*"