-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (74 loc) · 2.51 KB
/
clang.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
on:
workflow_dispatch:
inputs:
clang_bootstrap_major_version:
description: "Major version of clang we'll use to build the clang toolchain."
type: number
required: true
clang_version:
description: "Version of clang we'll build."
type: string
required: true
runner:
description: "Type of runner to use/architecture to build for."
type: choice
options:
- toolchains-ubuntu-22.04-x86
- toolchains-ubuntu-22.04-arm
cpu_target:
description: "Type of CPU to optimize for. (-mcpu)"
type: string
required: false
arch_target:
description: "Type of micro architecture to optimize for. (-march)"
type: string
required: false
github_tag:
description: "Tag to upload the release to."
type: string
required: true
name: Linux Clang
jobs:
build_clang:
name: build clang ${{ inputs.runner }}
runs-on: ${{ inputs.runner }}
permissions:
contents: write
steps:
- name: Clone MaterializeInc/toolchains repo
uses: actions/checkout@v4
- name: Get args
run: |
runner=${{ inputs.runner }}
runner_tag="${runner: -3}"
DOCKER_IMAGE_TAG="clang-${{ inputs.clang_version }}-$runner_tag"
echo "DOCKER_IMAGE_TAG=$DOCKER_IMAGE_TAG" >> $GITHUB_ENV
- name: Build in Docker
run: |
cd clang
docker build \
--build-arg BOOTSTRAP_CLANG_VERSION="${{ inputs.clang_bootstrap_major_version }}" \
--build-arg CLANG_VERSION="${{ inputs.clang_version }}" \
--build-arg TARGET_CPU="${{ inputs.cpu_target }}" \
--build-arg TARGET_CPU_ARCH="${{ inputs.arch_target }}" \
--target package_image \
--tag "$DOCKER_IMAGE_TAG" \
.
- name: Package Toolchain
run: |
container_id="$(docker create $DOCKER_IMAGE_TAG)"
docker cp "$container_id:/downloads/artifacts" .
- name: Determine Release Tag
run: |
RELEASE_TAG="linux-$GITHUB_TAG"
if [ -n "${{ inputs.github_tag }}" ]; then
RELEASE_TAG="${{ inputs.github_tag }}"
fi
echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV
- name: Upload toolchain to release
uses: svenstaro/upload-release-action@v2
with:
file: "artifacts/*.tar.zst"
file_glob: true
tag: ${{ env.RELEASE_TAG }}
overwrite: true