-
Notifications
You must be signed in to change notification settings - Fork 1
134 lines (113 loc) · 3.57 KB
/
build.yml
File metadata and controls
134 lines (113 loc) · 3.57 KB
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
name: RTL Build
permissions:
contents: write
on:
pull_request:
branches: [ release, develop ]
paths-ignore:
- '**/*.md'
push:
branches: [ release ]
paths-ignore:
- '**/*.md'
workflow_dispatch:
jobs:
build:
name: Build (${{ matrix.os }} / ${{ matrix.compiler }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
compiler: [gcc, clang, msvc]
exclude:
- os: windows-latest
compiler: gcc
- os: windows-latest
compiler: clang
- os: ubuntu-latest
compiler: msvc
steps:
- name: Checkout source
uses: actions/checkout@v4
# Linux dependencies
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install -y ninja-build g++ clang
# Configure (Linux)
- name: Configure (Linux)
if: runner.os == 'Linux'
run: |
if [ "${{ matrix.compiler }}" = "gcc" ]; then
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++;
else
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=clang++;
fi
# Configure (Windows / MSVC)
- name: Configure (Windows / MSVC)
if: runner.os == 'Windows'
run: cmake -B build -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release
# Build
- name: Build
run: cmake --build build --config Release --parallel
# Rename binaries (Linux)
- name: Rename binaries (Linux)
if: runner.os == 'Linux'
run: |
mv bin/RTLTestRunApp bin/RTLTestRunApp-${{ matrix.compiler }}
mv bin/RTLBenchmarkApp bin/RTLBenchmarkApp-${{ matrix.compiler }}
# Rename binaries (Windows / MSVC)
- name: Rename binaries (Windows)
if: runner.os == 'Windows'
run: |
ren bin\Release\RTLTestRunApp.exe RTLTestRunApp-msvc.exe
ren bin\Release\RTLBenchmarkApp.exe RTLBenchmarkApp-msvc.exe
# Upload artifacts (all builds)
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: rtl-test-binaries-${{ matrix.compiler }}
path: bin/
release:
if: github.ref == 'refs/heads/release'
needs: build
runs-on: ubuntu-latest
concurrency:
group: rolling-release-lock
cancel-in-progress: false
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download all build artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Update rolling tag
run: |
git tag -f release-latest
git push origin release-latest --force
- name: Delete existing release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if gh release view release-latest > /dev/null 2>&1; then
gh release delete release-latest -y
fi
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create release-latest \
--title "Rolling Release" \
--notes "Latest build from release branch - Updated $(date -u)" \
--verify-tag
- name: Upload assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -e
find artifacts -type f -print0 | xargs -0 gh release upload release-latest --clobber