-
Notifications
You must be signed in to change notification settings - Fork 1
174 lines (147 loc) · 5.88 KB
/
release.yml
File metadata and controls
174 lines (147 loc) · 5.88 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
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
# Copyright Agustin K-ballo Berge, Fusion Fenix 2026
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
name: release
on:
push:
tags: ['v*']
jobs:
build:
name: ${{ matrix.os }} / ${{ matrix.compiler }}
runs-on: ${{ matrix.os }}
if: ${{ !github.event.repository.fork }}
strategy:
fail-fast: false
matrix:
include:
# ── Linux / GCC 16 ──
- os: ubuntu-24.04
compiler: gcc-16
preset: dev-gcc
package_suffix: Linux-gcc-16
# ── Linux / Clang 22 ──
- os: ubuntu-24.04
compiler: clang-22
preset: dev-clang
package_suffix: Linux-clang-22
# ── Linux / Clang 22 + libc++ ──
- os: ubuntu-24.04
compiler: clang-22+libc++
preset: dev-clang-libcxx
package_suffix: Linux-clang-22-libcxx
# ── Windows 2025 / MSVC 2026 ──
- os: windows-2025-vs2026
compiler: msvc-2026
preset: dev-msvc
package_suffix: win64-msvc
# ── Windows 2025 / Clang-CL 20 ──
- os: windows-2025-vs2026
compiler: clang-cl-20
preset: dev-clang-cl
package_suffix: win64-clang-cl-20
steps:
- uses: actions/checkout@v5
- name: Set up MSVC environment
if: startsWith(matrix.compiler, 'msvc') || startsWith(matrix.compiler, 'clang-cl')
shell: pwsh
run: |
$vsPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" `
-latest -property installationPath
$vcvars = "$vsPath\VC\Auxiliary\Build\vcvars64.bat"
cmd /c "`"$vcvars`" && set" | ForEach-Object {
if ($_ -match '^([^=]+)=(.*)$') {
"$($Matches[1])=$($Matches[2])" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
}
}
- name: Set up APT package cache
if: runner.os == 'Linux'
run: |
mkdir -p ~/.cache/apt/archives/partial
echo "Dir::Cache::archives \"$HOME/.cache/apt/archives\";" \
| sudo tee /etc/apt/apt.conf.d/99user-cache
- name: Cache APT packages
if: runner.os == 'Linux'
uses: actions/cache@v5
with:
path: ~/.cache/apt/archives
key: apt-${{ matrix.os }}-${{ matrix.compiler }}-${{ hashFiles('.github/workflows/release.yml') }}
restore-keys: apt-${{ matrix.os }}-${{ matrix.compiler }}-
- name: Install GCC 16
if: matrix.compiler == 'gcc-16'
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update -q
sudo apt-get install -y gcc-16 g++-16
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-16 100 \
--slave /usr/bin/g++ g++ /usr/bin/g++-16
- name: Install Clang 22
if: startsWith(matrix.compiler, 'clang-22')
run: |
wget -q https://apt.llvm.org/llvm.sh
sudo bash llvm.sh 22 all
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-22 200
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-22 200
- name: Install Ninja
if: runner.os == 'Linux'
run: sudo apt-get install -y ninja-build
- name: Fix APT cache permissions
if: always() && runner.os == 'Linux'
run: sudo rm -rf ~/.cache/apt/archives/lock ~/.cache/apt/archives/partial
- name: Configure (static)
run: cmake --preset ${{ matrix.preset }} -B build/${{ matrix.preset }}-static
- name: Build (static, Release)
run: cmake --build build/${{ matrix.preset }}-static --config Release
- name: Package (static)
working-directory: build/${{ matrix.preset }}-static
run: cpack -C Release -D "CPACK_PACKAGE_FILE_NAME=Eggs.Assert-${{ github.ref_name }}-${{ matrix.package_suffix }}-static"
- name: Configure (shared)
run: cmake --preset ${{ matrix.preset }} -B build/${{ matrix.preset }}-shared
-DBUILD_SHARED_LIBS=ON
- name: Build (shared, Release)
run: cmake --build build/${{ matrix.preset }}-shared --config Release
- name: Package (shared)
working-directory: build/${{ matrix.preset }}-shared
run: cpack -C Release -D "CPACK_PACKAGE_FILE_NAME=Eggs.Assert-${{ github.ref_name }}-${{ matrix.package_suffix }}-shared"
- name: Stage packages
shell: bash
run: |
mkdir packages
shopt -s nullglob
cp build/${{ matrix.preset }}-static/Eggs.Assert-*.tar.gz \
build/${{ matrix.preset }}-static/Eggs.Assert-*.zip \
build/${{ matrix.preset }}-shared/Eggs.Assert-*.tar.gz \
build/${{ matrix.preset }}-shared/Eggs.Assert-*.zip \
packages/
- name: Upload packages
uses: actions/upload-artifact@v6
with:
name: packages-${{ matrix.compiler }}
path: packages/
if-no-files-found: error
publish:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download packages
uses: actions/download-artifact@v7
with:
pattern: packages-*
merge-multiple: true
path: packages/
- name: Create draft release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create ${{ github.ref_name }} \
--title "${{ github.ref_name }}" \
--generate-notes \
--draft \
--repo ${{ github.repository }}
- name: Upload to release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release upload ${{ github.ref_name }} \
packages/* \
--repo ${{ github.repository }}