Repository navigation
90 lines (88 loc) · 3.08 KB
/
Copy pathbuild.yml
File metadata and controls
90 lines (88 loc) · 3.08 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
79
80
81
82
83
84
85
86
87
88
89
90
on:
push:
branches:
- buildscripts
tags:
- '*'
workflow_dispatch:
permissions:
contents: read
env:
LLVM_VERSION: 17.0.8
APPLE_LLVM_TAG: swift-6.0-DEVELOPMENT-SNAPSHOT-2024-06-08-a
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: macos-26
arch: arm64
- os: macos-26
arch: x86_64
runs-on: ${{ matrix.os }}
env:
LLVM_ARCH: ${{ matrix.arch }}
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_BASEDIR: ${{ github.workspace }}
CCACHE_MAXSIZE: 3G
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: swiftlang/llvm-project
ref: ${{ env.APPLE_LLVM_TAG }}
persist-credentials: false
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
path: ios-llvm
persist-credentials: false
- name: Install dependencies
run: |
brew install ninja ccache
- name: Restore ccache
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ matrix.os }}-${{ matrix.arch }}-${{ env.APPLE_LLVM_TAG }}-${{ github.run_id }}
restore-keys: |
ccache-${{ matrix.os }}-${{ matrix.arch }}-${{ env.APPLE_LLVM_TAG }}-
ccache-${{ matrix.os }}-${{ matrix.arch }}-
- name: Configure
run: ios-llvm/build.sh configure --arch $LLVM_ARCH --source . --build-dir build_osx --ccache
- name: Build
run: |
ccache -z
ios-llvm/build.sh build --arch $LLVM_ARCH --build-dir build_osx
ccache -s
- name: Save ccache
if: always()
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ matrix.os }}-${{ matrix.arch }}-${{ env.APPLE_LLVM_TAG }}-${{ github.run_id }}
- name: Check install contents
run: ios-llvm/build.sh check --arch $LLVM_ARCH --build-dir build_osx
- name: Create archive
run: ios-llvm/build.sh package --arch $LLVM_ARCH --build-dir build_osx --version $LLVM_VERSION --out-dir dist
- name: Upload archive
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: llvm-${{ env.LLVM_VERSION }}-${{ env.LLVM_ARCH }}
path: dist/llvm-${{ env.LLVM_VERSION }}-${{ env.LLVM_ARCH }}.tgz
compression-level: 0
release:
name: Release
if: ${{ startsWith(github.ref, 'refs/tags/') }}
permissions:
contents: write
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Download archives
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
pattern: llvm-*
merge-multiple: true
- uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd # v1.21.0
with:
artifacts: llvm-${{ env.LLVM_VERSION }}-*.tgz