-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (111 loc) · 3.3 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
111
name: Build Toolchain
on:
push:
branches:
- main
tags:
- r**
pull_request:
workflow_dispatch:
jobs:
build:
name: Build Toolchain
runs-on: ubuntu-22.04
steps:
- name: Checkout Repo
uses: actions/checkout@main
- name: Free additional disk space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
android: false
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Build Toolchain
run: bash build.sh
- name: Waiting for debugger
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
- name: Upload Build Archive
uses: actions/upload-artifact@v2
with:
name: output-${{ github.sha }}
path: ${{ github.workspace }}/output
build-flang:
name: Build Flang Libraries
runs-on: ubuntu-22.04
needs: build
strategy:
matrix:
# target_arch_or_type: [host, aarch64, arm, i686, x86_64]
target_arch_or_type: [host, aarch64, x86_64]
steps:
- name: Checkout Repo
uses: actions/checkout@main
- name: Install dependicies
run: |
sudo apt update
sudo apt install -yq cmake ninja-build libzstd-dev
- name: Fetch archives
uses: actions/download-artifact@v2
with:
path: ./
- name: Copy archives
run: |
cp output-${{ github.sha }}/*.tar.bz2 ./
rm -rf output-${{ github.sha }}
- name: Extract Tarballs
run: |
ls *.tar.bz2 | xargs -n1 tar xf
rm -rf *.tar.bz2
- name: Build Flang
env:
BUILD_ARCH_OR_TYPE: ${{ matrix.target_arch_or_type }}
run: bash build-flang.sh
- name: Waiting for debugger
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
- name: Upload Build Archive
uses: actions/upload-artifact@v2
with:
name: output-flang-${{ matrix.target_arch_or_type }}-${{ github.sha }}
path: ${{ github.workspace }}/output-flang
release:
name: Create Github Release
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
needs: build-flang
runs-on: ubuntu-22.04
steps:
- name: Fetch archives
uses: actions/download-artifact@v2
with:
path: ./
- name: Copy archives
run: |
cp output-${{ github.sha }}/*.tar.bz2 ./
cp output-flang-*-${{ github.sha }}/*.tar.bz2 ./
rm -rf output-${{ github.sha }} output-flang-${{ github.sha }}
rm -rf package-llvm-project.tar.bz2 package-stage2-install.tar.bz2
- name: Get checksums
id: checksums
run: |
checksums=$(printf 'SHA-256:\n```\n%s\n```\n' "$(sha256sum *.tar.bz2)")
checksums="${checksums//'%'/'%25'}"
checksums="${checksums//$'\n'/'%0A'}"
checksums="${checksums//$'\r'/'%0D'}"
echo "::set-output name=checksums::$checksums"
- name: Get tag
id: tag
uses: dawidd6/action-get-tag@v1
- name: Publish GitHub release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: "*.tar.bz2"
file_glob: true
release_name: "Android NDK toolchain with Flang"
tag: ${{ steps.tag.outputs.tag }}
body: ${{ steps.checksums.outputs.checksums }}