forked from llvm-mos/llvm-mos
-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (104 loc) · 3.51 KB
/
package.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
106
107
108
109
110
111
112
113
name: Packaging
concurrency: compiler-package
on:
workflow_dispatch:
push:
ignore-forks: true
branches: [main]
jobs:
package:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2019, macos-latest, ubuntu-20.04]
steps:
- name: Setup Windows
if: startsWith(matrix.os, 'windows')
uses: llvm/actions/setup-windows@main
with:
arch: amd64
# On Windows, starting with win19/20220814.1, cmake choose the 32-bit
# python3.10.6 libraries instead of the 64-bit libraries when building
# lldb. Using this setup-python action to make 3.10 the default
# python fixes this.
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Ninja
uses: llvm/actions/install-ninja@main
# actions/checkout deletes any existing files in the new git directory,
# so this needs to either run before ccache-action or it has to use
# clean: false.
- name: Checkout
uses: actions/checkout@v3
- name: Configure POSIX
if: ${{!startsWith(matrix.os, 'windows')}}
run: |
mkdir build
cd build
cmake \
-GNinja \
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/llvm-mos \
-C../clang/cmake/caches/MOS.cmake \
../llvm
- name: Configure Windows
if: startsWith(matrix.os, 'windows')
run: |
mkdir build
cd build
cmake `
-GNinja `
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/llvm-mos `
-DCMAKE_C_COMPILER=cl `
-DCMAKE_CXX_COMPILER=cl `
-C../clang/cmake/caches/MOS.cmake `
../llvm
- name: Build
run: cd build; ninja distribution
- name: Install
run: cd build; ninja install-distribution-stripped
- name: Archive Linux
if: startsWith(matrix.os, 'ubuntu')
run: tar -cJvf llvm-mos-linux-main.tar.xz llvm-mos
- name: Archive Windows
if: startsWith(matrix.os, 'windows')
run: 7z a llvm-mos-windows-main.7z llvm-mos
- name: Archive macOS
if: startsWith(matrix.os, 'macos')
run: tar -cJvf llvm-mos-darwin-main.tar.xz llvm-mos
- name: Release Linux
if: startsWith(matrix.os, 'ubuntu')
uses: softprops/action-gh-release@v1
with:
prerelease: true
body: "Internal compiler build for Linux"
tag_name: llvm-mos-linux-main
files: llvm-mos-linux-main.tar.xz
- name: Release macOS
if: startsWith(matrix.os, 'macos')
uses: softprops/action-gh-release@v1
with:
prerelease: true
body: "Internal compiler build for macOS"
tag_name: llvm-mos-darwin-main
files: llvm-mos-darwin-main.tar.xz
- name: Release Windows
if: startsWith(matrix.os, 'windows')
uses: softprops/action-gh-release@v1
with:
prerelease: true
body: "Internal compiler build for Windows"
tag_name: llvm-mos-windows-main
files: llvm-mos-windows-main.7z
dispatch-sdk:
needs: package
runs-on: ubuntu-latest
steps:
- name: Dispatch SDK Packaging
uses: llvm-mos/repository-dispatch@v1
with:
token: ${{ secrets.ACTION_TOKEN }}
repository: llvm-mos/llvm-mos-sdk
event-type: on-llvm-update
client-payload: '{"head_commit": ${{ toJSON(github.event.head_commit) }}}'