-
Notifications
You must be signed in to change notification settings - Fork 0
176 lines (174 loc) · 5.48 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
name: NES Clang builder
on:
push:
tags:
- 'v*'
jobs:
build-x64-linux:
timeout-minutes: 360
env:
VCPKG_DEP_LIST: x64-linux
VCPKG_FEATURE_FLAGS: -binarycaching
runs-on: [self-hosted, linux, X64, dep-builder]
strategy:
fail-fast: false
matrix:
osversion: [ubuntu-22.04, ubuntu-20.04, ubuntu-18.04]
steps:
- uses: AutoModality/action-clean@v1
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Set output vars to the actual tag name
id: vars
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: Build Docker
id: builddocker
working-directory: ${{ github.workspace }}/docker/
run: docker build -t nes_clang_build_${{ matrix.osversion }} -f Dockerfile-${{ matrix.osversion }} .
- name: Build Clang
id: installdeps
run: |
docker run -v ${{ github.workspace }}:/build_dir --rm nes_clang_build_${{ matrix.osversion }} \
./build_dir/build_ubuntu-x64.sh
- name: Compress artifacts
id: compressdeps
run: |
7z a nes-clang-16-${{ matrix.osversion }}-X64.7z clang -mx9 -aoa
- name: Release
uses: softprops/action-gh-release@v1
id: createrelease
with:
files: |
nes-clang-16-${{ matrix.osversion }}-X64.7z
- name: Clean build artifacts
id: cleanbuildartifacts
if: always()
run: |
rm -rf llvm-project
rm -rf .git
rm -rf clang
- name: Remove docker image
id: removedockerimage
if: always()
run: |
test -n "$(docker image ls -q nes_clang_build_${{ matrix.osversion }})" && \
docker image rm $(docker image ls -q nes_clang_build_${{ matrix.osversion }}) || \
true
build-arm-linux:
env:
VCPKG_DEP_LIST: arm64-linux
VCPKG_FEATURE_FLAGS: -binarycaching
runs-on: [self-hosted, linux, ARM64, dep-builder]
strategy:
matrix:
osversion: [ubuntu-22.04]
steps:
- uses: AutoModality/action-clean@v1
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Set output vars to the actual tag name
id: vars
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: Build Docker
id: builddocker
working-directory: ${{ github.workspace }}/docker/
run: docker build -t nes_clang_build_${{ matrix.osversion }} -f Dockerfile-${{ matrix.osversion }} .
- name: Build Clang
id: installdeps
run: |
docker run -v ${{ github.workspace }}:/build_dir --rm nes_clang_build_${{ matrix.osversion }} \
./build_dir/build_ubuntu-arm64.sh
- name: Compress artifacts
id: compressdeps
run: |
7z a nes-clang-16-${{ matrix.osversion }}-arm64.7z clang -mx9 -aoa
- name: Release
uses: softprops/action-gh-release@v1
id: createrelease
with:
files: |
nes-clang-16-${{ matrix.osversion }}-arm64.7z
- name: Clean build artifacts
id: cleanbuildartifacts
if: always()
run: |
rm -rf clang
rm -rf llvm-project
rm -rf .git
- name: Remove docker image
id: removedockerimage
if: always()
run: |
test -n "$(docker image ls -q nes_clang_build_${{ matrix.osversion }})" && \
docker image rm $(docker image ls -q nes_clang_build_${{ matrix.osversion }}) || \
true
build-arm-osx:
timeout-minutes: 360
env:
VCPKG_DEP_LIST: arm64-osx
VCPKG_FEATURE_FLAGS: -binarycaching
runs-on: [ self-hosted, macos, ARM64]
steps:
- uses: lukka/get-cmake@latest
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Set output vars to the actual tag name
id: vars
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: Build OSX ARM Clang
id: buildclang
run: |
${{ github.workspace }}/build_osx-arm64.sh
shell: bash
- name: Compress artifacts
id: compressdeps
run: |
7z a nes-clang-16-osx-arm64.7z clang -mx9 -aoa
- name: Release
uses: softprops/action-gh-release@v1
id: createrelease
with:
files: |
nes-clang-16-osx-arm64.7z
- name: Clean build artifacts
id: cleanbuildartifacts
if: always()
run: |
rm -rf clang
build-x64-osx:
timeout-minutes: 360
env:
VCPKG_DEP_LIST: x64-osx
VCPKG_FEATURE_FLAGS: -binarycaching
runs-on: [ self-hosted, macos, X64, dep-builder ]
steps:
- uses: lukka/get-cmake@latest
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Set output vars to the actual tag name
id: vars
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: Build OSX x64 Clang
id: buildclang
run: |
${{ github.workspace }}/build_osx-x64.sh
shell: bash
- name: Compress artifacts
id: compressdeps
run: |
7z a nes-clang-16-osx-x64.7z clang -mx9 -aoa
- name: Release
uses: softprops/action-gh-release@v1
id: createrelease
with:
files: |
nes-clang-16-osx-x64.7z
- name: Clean build artifacts
id: cleanbuildartifacts
if: always()
run: |
rm -rf clang