-
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (77 loc) · 2.35 KB
/
build.yml
File metadata and controls
78 lines (77 loc) · 2.35 KB
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
on:
push:
branches:
- buildscripts
tags:
- '*'
env:
LLVM_VERSION: 21.0.0
APPLE_LLVM_TAG: swift-6.3.1-RELEASE
jobs:
build:
strategy:
matrix:
include:
- os: macos-26
arch: arm64
upload_includes: true
- os: macos-26
arch: x86_64
runs-on: ${{ matrix.os }}
env:
LLVM_ARCH: ${{ matrix.arch }}
steps:
- uses: actions/checkout@v4
with:
repository: swiftlang/llvm-project
ref: ${{env.APPLE_LLVM_TAG}}
- name: Install dependencies
run: |
brew install ninja
- name: Build
run: |
cmake -S llvm -B build_osx -G "Ninja" -DCMAKE_OSX_DEPLOYMENT_TARGET=11 -DCMAKE_OSX_ARCHITECTURES=$LLVM_ARCH -DLLVM_ENABLE_RUNTIMES="" -DLLVM_ENABLE_PROJECTS="clang;lld;polly" -DLLVM_ENABLE_ASSERTIONS=Off -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/tmp/llvm -DLLVM_ENABLE_ZSTD=Off -DLLVM_HOST_TRIPLE=$LLVM_ARCH-apple-darwin -DBUILD_SHARED_LIBS=Off
cmake --build build_osx --target install
- name: Generate artifact
run: |
cd /tmp/llvm
mkdir dist-lib
mv lib dist-lib/lib_$LLVM_ARCH
mkdir dist-include
mv include dist-include/include
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: llvm-lib-${{env.LLVM_ARCH}}
path: /tmp/llvm/dist-lib
- name: Upload includes
if: ${{ matrix.upload_includes }}
uses: actions/upload-artifact@v4
with:
name: llvm-include
path: /tmp/llvm/dist-include
artifacts:
name: Assemble release
permissions:
contents: write
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ${{env.LLVM_VERSION}}
pattern: llvm-*
merge-multiple: true
- name: Create archive
run: |
tar -czf llvm-$LLVM_VERSION.tgz $LLVM_VERSION
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: llvm-${{env.LLVM_VERSION}}
path: llvm-${{env.LLVM_VERSION}}.tgz
- uses: ncipollo/release-action@v1
if: ${{ contains(github.ref, 'refs/tags/') }}
with:
artifacts: llvm-${{env.LLVM_VERSION}}.tgz