generated from TheLartians/ModernCppStarter
-
Notifications
You must be signed in to change notification settings - Fork 1
142 lines (125 loc) · 3.73 KB
/
release.yml
File metadata and controls
142 lines (125 loc) · 3.73 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
name: Release
on:
push:
tags:
- "v*.*.*"
env:
CTEST_OUTPUT_ON_FAILURE: 1
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-24.04
preset: linux-ninja-Release
build-preset: linux-ninja-Release
cpack-generators: "TGZ;DEB;RPM"
package-patterns: |
build/cmcpp-*.tar.gz
build/cmcpp_*.deb
build/cmcpp-*.rpm
extra-deps: |
sudo apt-get update
sudo apt-get install -y \
autoconf \
autoconf-archive \
automake \
build-essential \
ninja-build \
rpm
- os: windows-2022
preset: vcpkg-VS-17
build-preset: VS-17-Release
cpack-generators: "ZIP;NSIS"
cpack-config: "-C Release"
package-patterns: |
build/cmcpp-*.zip
build/cmcpp-*.exe
extra-deps: ""
# Disabled: Known to fail
# To re-enable, uncomment the macOS section below
# - os: macos-14
# preset: linux-ninja-Release
# build-preset: linux-ninja-Release
# cpack-generators: "TGZ;ZIP"
# package-patterns: |
# build/cmcpp-*.tar.gz
# build/cmcpp-*.zip
# extra-deps: |
# brew install \
# pkg-config \
# autoconf \
# autoconf-archive \
# automake \
# coreutils \
# libtool \
# cmake \
# ninja
runs-on: ${{ matrix.os }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
if: matrix.extra-deps != ''
run: ${{ matrix.extra-deps }}
- name: Set up JDK 17
if: startsWith(matrix.os, 'windows')
uses: actions/setup-java@v5
with:
java-version: "17"
distribution: "temurin"
- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Cache vcpkg registry
if: always()
uses: actions/cache@v4
with:
path: |
build/vcpkg_installed/
build/vcpkg_packages/
key: ${{ runner.os }}-vcpkg-${{ hashFiles('./vcpkg*.json') }}
restore-keys: |
${{ runner.os }}-vcpkg-
- name: Install Rust dependencies
run: |
cargo install wasm-tools wit-bindgen-cli || true
- name: Configure CMake
run: |
cmake --preset ${{ matrix.preset }}
- name: Build
run: |
cmake --build --preset ${{ matrix.build-preset }}
- name: Create Packages
working-directory: build
run: |
IFS=';' read -ra GENS <<< "${{ matrix.cpack-generators }}"
for gen in "${GENS[@]}"; do
cpack ${{ matrix.cpack-config || '' }} -G "$gen"
done
shell: bash
- name: Upload Packages
uses: softprops/action-gh-release@v2
with:
files: ${{ matrix.package-patterns }}
fail_on_unmatched_files: false
generate_release_notes: true
draft: false
prerelease: false
- name: Upload error logs
if: ${{ failure() || cancelled() }}
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-logs
path: ./**/*.log