-
Notifications
You must be signed in to change notification settings - Fork 3
174 lines (156 loc) · 5.08 KB
/
Copy pathmain.yml
File metadata and controls
174 lines (156 loc) · 5.08 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
name: Continuous Integration
permissions:
contents: write
on:
push:
branches: [main]
tags: ["*"]
paths-ignore: ["**.md"]
pull_request:
branches: [main]
paths-ignore: ["**.md"]
workflow_dispatch:
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
defaults:
run:
shell: ${{ matrix.config.shell }}
strategy:
fail-fast: false
matrix:
config:
- name: Linux x86_64
os: ubuntu-latest
shell: bash
package_name: linux_x86_64
artifact_path: build/*.zip
install: |
sudo apt-get update
sudo apt-get install -y \
clang \
lld \
libc++-dev \
libc++abi-dev \
ninja-build
configure: |
-G Ninja \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_LINKER=lld \
-DCMAKE_CXX_FLAGS="-stdlib=libc++" \
-DCMAKE_EXE_LINKER_FLAGS="-Wl,--gc-sections"
- name: MacOS Universal
os: macos-latest
shell: bash
package_name: macos_universal
artifact_path: build/*.zip
install: |
brew update
brew install ninja
# HACK: temporarily disable the x86 part of the universal build
# need to move to lipo instead of CMAKE_OSX_ARCHITECTURES
configure: |
-G Ninja \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_OSX_ARCHITECTURES="arm64"
- name: Windows MinGW x86_64
os: windows-latest
shell: "msys2 {0}"
msystem: mingw64
msys-env: mingw-w64-x86_64
package_name: windows_x86_64
artifact_path: build/*.zip
install: |
pacman -Syu --noconfirm
pacman -S --noconfirm \
mingw-w64-x86_64-clang \
mingw-w64-x86_64-clang-tools-extra \
mingw-w64-x86_64-lld \
mingw-w64-x86_64-cmake \
mingw-w64-x86_64-ninja \
mingw-w64-x86_64-git
configure: |
-G Ninja \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_LINKER=lld \
-DCMAKE_EXE_LINKER_FLAGS="-static -Wl,--gc-sections" \
-DCMAKE_SHARED_LINKER_FLAGS="-static"
steps:
- name: Setup MSYS2
if: matrix.config.shell == 'msys2 {0}'
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.config.msystem }}
update: true
- uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 0 # Required so we can move and push tags
- name: Install dependencies
run: ${{ matrix.config.install }}
- name: Configure (Release)
if: ${{ contains(github.ref, 'tags') }}
run: >-
cmake
-S .
-B build
-DCMAKE_BUILD_TYPE=Release
${{ matrix.config.configure }}
- name: Configure (Nightly)
if: ${{ !contains(github.ref, 'tags') }}
run: >-
cmake
-S .
-B build
-DCMAKE_BUILD_TYPE=Release
-DCPACK_PACKAGE_VERSION=nightly
${{ matrix.config.configure }}
- name: Build
run: cmake --build build
- name: Install
run: |
cd build
cpack
- name: Extract Version Number (Release)
if: contains(github.ref, 'tags')
shell: bash
run: echo "VERSION=${GITHUB_REF##*_}" >> $GITHUB_ENV
- name: Extract Version Number (Development)
if: "!contains(github.ref, 'tags')"
shell: bash
run: echo "VERSION=${GITHUB_SHA::7}" >> $GITHUB_ENV
- name: Upload Artifacts
uses: actions/upload-artifact@v7
with:
name: elfbsp_${{ env.VERSION }}_${{ matrix.config.package_name }}
path: ${{ matrix.config.artifact_path }}
- name: Release
if: ${{ contains(github.ref, 'tags') }}
uses: ncipollo/release-action@v1
with:
name: ELFBSP ${{ env.VERSION }}
bodyFile: CHANGELOG.md
allowUpdates: true
artifacts: ${{ matrix.config.artifact_path }}
- name: Update Nightly Tag
if: ${{ !contains(github.ref, 'tags') && github.ref == 'refs/heads/main' }}
run: |
git tag -d nightly || true
git push origin :refs/tags/nightly || true
git tag nightly HEAD
git push origin nightly
- name: Nightly Pre-Release
if: ${{ !contains(github.ref, 'tags') && github.ref == 'refs/heads/main' }}
uses: ncipollo/release-action@v1
with:
name: "[Nightly] ELFBSP ${{ env.VERSION }}"
bodyFile: CHANGELOG.md
tag: nightly
commit: main
prerelease: true
allowUpdates: true
artifacts: ${{ matrix.config.artifact_path }}