forked from Spacefreak18/simapi
-
Notifications
You must be signed in to change notification settings - Fork 0
227 lines (189 loc) · 6.65 KB
/
ci.yaml
File metadata and controls
227 lines (189 loc) · 6.65 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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
name: CMake on multiple platforms
on:
push:
tags: [ "*" ]
jobs:
build-simapi:
strategy:
matrix:
os: [ubuntu-latest, debian-latest, debian-stable]
runs-on: ${{ matrix.os }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Set build dir
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
github_sha_hash=${{ github.sha }}
echo "github-sha-short=${github_sha_hash:0:7}" >> $GITHUB_OUTPUT
- name: Update apt
run: sudo apt update
- name: Install Dependencies
run: sudo apt install -y libuv1-dev libargtable2-dev libconfig-dev libyder-dev
- name: Configure CMake
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=g++
-DCMAKE_C_COMPILER=gcc
-DCMAKE_BUILD_TYPE=Release
-DBUILD_SIMD=ON
-S ${{ github.workspace }}
- name: Build
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config Release
- name: Build simapi debian package
run: |
rm -rf SIMAPI_PKG_SOURCE
mkdir SIMAPI_PKG_SOURCE
mkdir -p SIMAPI_PKG_SOURCE/DEBIAN
mkdir -p SIMAPI_PKG_SOURCE/usr/lib/x86_64-linux-gnu/
cp ./tools/distro/debian/dpkg/${{ matrix.os }}/simapi_control ./SIMAPI_PKG_SOURCE/DEBIAN/control
cp -r \
build/libsimapi.so \
build/libsimapi.so.1 \
build/libsimapi.so.1.0.1 \
SIMAPI_PKG_SOURCE/usr/lib/x86_64-linux-gnu/
dpkg-deb --build SIMAPI_PKG_SOURCE simapi-${{ matrix.os }}.deb
- name: Build simd debian package
run: |
rm -rf SIMD_PKG_SOURCE
mkdir SIMD_PKG_SOURCE
mkdir -p SIMD_PKG_SOURCE/DEBIAN
mkdir -p SIMD_PKG_SOURCE/usr/bin/
cp ./tools/distro/debian/dpkg/${{ matrix.os }}/simd_control ./SIMD_PKG_SOURCE/DEBIAN/control
cp build/simd/simd ./SIMD_PKG_SOURCE/usr/bin/simd
dpkg-deb --build SIMD_PKG_SOURCE simd-${{ matrix.os }}.deb
- name: Release the Package
uses: softprops/action-gh-release@v1
with:
files: simapi-${{ matrix.os }}.deb
- name: Release the Package
uses: softprops/action-gh-release@v1
with:
files: simd-${{ matrix.os }}.deb
build-simapi-rpms:
strategy:
matrix:
os: [fedora-43]
runs-on: ${{ matrix.os }}
permissions:
contents: write
steps:
- name: create rpmbuild dirs
run: mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
- name: get spec file
run: curl -o ~/simapi.spec https://raw.githubusercontent.com/Spacefreak18/simapi/refs/heads/master/tools/distro/fedora/rpm/simapi.spec
- name: run spec file
run: rpmbuild -ba ~/simapi.spec
- name: rename file
run: cp ~/rpmbuild/RPMS/x86_64/libsimapi-0.0.5-1.x86_64.rpm $GITHUB_WORKSPACE/libsimapi-${{ matrix.os }}.rpm
- name: get spec file
run: curl -o ~/simd.spec https://raw.githubusercontent.com/Spacefreak18/simapi/refs/heads/master/tools/distro/fedora/rpm/simd.spec
- name: run spec file
run: rpmbuild -ba ~/simd.spec
- name: rename file
run: cp ~/rpmbuild/RPMS/x86_64/simd-0.0.5-1.x86_64.rpm $GITHUB_WORKSPACE/simd-${{ matrix.os }}.rpm
- name: Release libsimapi Package
uses: softprops/action-gh-release@v1
with:
files: libsimapi-${{ matrix.os }}.rpm
- name: Release simd Package
uses: softprops/action-gh-release@v1
with:
files: simd-${{ matrix.os }}.rpm
build-simapi-nix:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@4e002c8ec80594ecd40e759629461e26c8abed15
- uses: nicknovitski/nix-develop@9be7cfb4b10451d3390a75dc18ad0465bed4932a
with:
arguments: ".#simapi"
- name: Set build dir
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
github_sha_hash=${{ github.sha }}
echo "github-sha-short=${github_sha_hash:0:7}" >> $GITHUB_OUTPUT
- name: Configure CMake
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=g++
-DCMAKE_C_COMPILER=gcc
-DCMAKE_BUILD_TYPE=Release
-DBUILD_SIMD=OFF
-S ${{ github.workspace }}
- name: Build
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config Release
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: simapi-build
path: ${{ steps.strings.outputs.build-output-dir }}
- name: Prepare release
run: |
mkdir simapi_release
cp -r \
include \
build/libsimapi.so \
build/libsimapi.so.1 \
build/libsimapi.so.1.0.1 \
build/simapi.pc \
simapi_release/
cd simapi_release
tar -czvf simapi.tar.gz ./*
- name: Set tarball name
if: github.ref_type == 'tag'
run: |
cd simapi_release
mv simapi.tar.gz simapi-${{ github.ref_name }}.tar.gz
- name: Release
uses: softprops/action-gh-release@v2
if: github.ref_type == 'tag'
with:
name: SimAPI ${{ github.ref_name }}
fail_on_unmatched_files: true
files: |
simapi_release/simapi-${{ github.ref_name }}.tar.gz
build-simd-nix:
runs-on: ubuntu-latest
needs: build-simapi
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@4e002c8ec80594ecd40e759629461e26c8abed15
- uses: nicknovitski/nix-develop@9be7cfb4b10451d3390a75dc18ad0465bed4932a
with:
arguments: ".#simd"
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: simapi-build
- name: Set build dir
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/simd/build" >> "$GITHUB_OUTPUT"
github_sha_hash=${{ github.sha }}
echo "github-sha-short=${github_sha_hash:0:7}" >> $GITHUB_OUTPUT
- name: Configure CMake
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=g++
-DCMAKE_C_COMPILER=gcc
-DCMAKE_BUILD_TYPE=Release
-S ${{ github.workspace }}/simd
- name: Build
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config Release
- name: Release
uses: softprops/action-gh-release@v2
if: github.ref_type == 'tag'
with:
name: Simd ${{ github.ref_name }}
fail_on_unmatched_files: true
files: |
simd/build/simd