forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (101 loc) · 4.59 KB
/
build.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
name: Build CoreCLR
on: push
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
arch: [x64, x86]
configuration: [Release, Debug]
exclude:
- os: macos-latest
arch: x86
steps:
- id: set-vars
uses: actions/github-script@v6
with:
script: |
const os = "${{ matrix.os }}";
const arch = "${{ matrix.arch }}";
const configuration = "${{ matrix.configuration }}";
switch (os) {
case "ubuntu-latest":
core.setOutput("extension", "so");
core.setOutput("os-name", "Linux");
core.setOutput("rid", "linux-" + arch);
core.setOutput("build-cmd", "./build.sh");
break;
case "windows-latest":
core.setOutput("extension", "dll");
core.setOutput("os-name", "windows");
core.setOutput("rid", "windows-" + arch);
core.setOutput("build-cmd", ".\\build.cmd");
break;
case "macos-latest":
core.setOutput("extension", "dylib");
core.setOutput("os-name", "OSX");
core.setOutput("rid", "macos-" + arch);
core.setOutput("build-cmd", "./build.sh");
break;
}
core.setOutput("build-date", new Date().toISOString().split('T')[0].replace(/-/g, ''));
- uses: actions/checkout@v3
- if: matrix.os == 'ubuntu-latest'
name: Install linux dependencies
run: |
sudo apt update
sudo apt install -y libkrb5-dev liblttng-ust-dev
- if: matrix.os == 'ubuntu-latest' && matrix.arch == 'x86'
name: Build 32bit linux
run: |
sudo apt install -y debootstrap qemu-user-static qemu clang-9 libclang-9-dev llvm-9-dev
. /etc/os-release
sudo ./eng/common/cross/build-rootfs.sh x86 $VERSION_CODENAME
ROOTFS_DIR=`pwd`/.tools/rootfs/x86 ./build.sh clr.runtime+clr.corelib+libs --cross --clang9 --arch x86 -c ${{ matrix.configuration }} /p:OfficialBuildId=${{ steps.set-vars.outputs.build-date }}.0
- name: Build
if: matrix.os != 'ubuntu-latest' || matrix.arch != 'x86'
run: |
${{ steps.set-vars.outputs.build-cmd }} clr.runtime+clr.corelib+libs -c ${{ matrix.configuration }} -a ${{ matrix.arch }} /p:OfficialBuildId=${{ steps.set-vars.outputs.build-date }}.0
- name: Collect final build
shell: bash
run: |
mkdir -p artifacts/ci/${{ steps.set-vars.outputs.rid }}
cp artifacts/bin/coreclr/${{ steps.set-vars.outputs.os-name }}.${{ matrix.arch }}.${{ matrix.configuration }}/${{ matrix.os != 'windows-latest' && 'lib{' || '{clretwrc,mscorrc,' }}clrgc,clrjit,coreclr,jitinterface_${{ matrix.arch }},mscordaccore,mscordbi}.${{ steps.set-vars.outputs.extension }} artifacts/ci/${{ steps.set-vars.outputs.rid }}/
cp artifacts/bin/coreclr/${{ steps.set-vars.outputs.os-name }}.${{ matrix.arch }}.${{ matrix.configuration }}/IL/System.Private.CoreLib.dll artifacts/ci/${{ steps.set-vars.outputs.rid }}/
cp artifacts/bin/runtime/net*-${{ steps.set-vars.outputs.os-name }}-${{ matrix.configuration }}-${{ matrix.arch }}/*.{dll,${{ steps.set-vars.outputs.extension }}} artifacts/ci/${{ steps.set-vars.outputs.rid }}/
- uses: actions/upload-artifact@v3
with:
name: ${{ steps.set-vars.outputs.rid }}-${{ matrix.configuration }}
path: |
artifacts/ci/${{ steps.set-vars.outputs.rid }}
- uses: actions/upload-artifact@v3
with:
name: mini-coreclr-${{ matrix.configuration }}
path: |
artifacts/ci/
create_release:
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Collect files
id: collect-info
run: |
mkdir release
cd artifacts
for i in */; do (cd "${i%/}" && zip -0 -r "../../release/${i%/}.zip" *) & done; wait
echo "::set-output name=release_tag::$(date +%Y%m%d).$GITHUB_RUN_NUMBER"
- name: Create release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: ${{ steps.collect-info.outputs.release_tag }}
title: "Build ${{ steps.collect-info.outputs.release_tag }}"
files: |
release/*.zip