-
Notifications
You must be signed in to change notification settings - Fork 7
206 lines (163 loc) · 5.81 KB
/
release.yml
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
name: Release
on:
push:
tags:
- '*'
env:
BUILD_TYPE: Release
jobs:
deb:
if: true
runs-on: ubuntu-latest
container:
image: debian:bookworm
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: apt-get -y update && apt-get install -y libgmp-dev build-essential cmake
- name: Cmake
run: cmake -G "Unix Makefiles" -B./build -DCMAKE_BUILD_TYPE=$BUILD_TYPE
- name: Build
run: cmake --build ./build
- name: Package
id: package
working-directory: build
run: |
cpack -G "DEB" -D CPACK_PACKAGE_FILE_NAME=libbncsutil-dev_${{ github.ref_name }}_amd64
- uses: actions/upload-artifact@v4
with:
retention-days: 1
overwrite: true
name: libbncsutil-dev_${{ github.ref_name }}_amd64.deb
path: build/libbncsutil-dev_${{ github.ref_name }}_amd64.deb
rpm:
if: true
runs-on: ubuntu-latest
container:
image: fedora:latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: dnf -y install gmp-devel make automake clang cmake rpm-build
- name: Cmake
run: cmake -G "Unix Makefiles" -B./build -DCMAKE_BUILD_TYPE=$BUILD_TYPE
- name: Build
run: cmake --build ./build
- name: Package
working-directory: build
run: cpack -G "RPM" -D CPACK_PACKAGE_FILE_NAME=libbncsutil-devel-${{ github.ref_name }}.x86_64
- uses: actions/upload-artifact@v4
with:
retention-days: 1
overwrite: true
name: libbncsutil-devel-${{ github.ref_name }}.x86_64.rpm
path: build/libbncsutil-devel-${{ github.ref_name }}.x86_64.rpm
dll_amd64:
if: true
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: TheMrMilchmann/setup-msvc-dev@v3
with:
arch: x64
- name: Cache Conan
uses: actions/cache@v3
with:
key: conan-windows-amd64-${{ hashFiles('conanfile.py') }}
path: |
~/.conan2/p
- name: Install Conan
id: conan
uses: turtlebrowser/get-conan@main
- name: Init conan
run: conan profile detect
- name: Install dependencies
shell: cmd
run: conan install . -of build -s build_type=Release -o *:shared=False --build=missing
- name: Build
shell: cmd
working-directory: ./build
run: .\conanbuild.bat && cmake .. -G "Visual Studio 17 2022" -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DBUILD_SHARED_LIBS=1 && cmake --build . --config Release
- name: Create archive
working-directory: ./build
run: |
New-Item -ItemType Directory -Path include/bncsutil -Force | Out-Null
Copy-Item -Path '../src/bncsutil/*.h' -Destination include/bncsutil
Compress-Archive -Path Release/* -DestinationPath bncsutil_${{ github.ref_name }}_amd64_dll.zip
Compress-Archive -Path include -DestinationPath "bncsutil_${{ github.ref_name }}_amd64_dll.zip" -Update
- uses: actions/upload-artifact@v4
with:
retention-days: 1
overwrite: true
name: bncsutil_${{ github.ref_name }}_amd64_dll.zip
path: build/bncsutil_${{ github.ref_name }}_amd64_dll.zip
dll_x86:
if: true
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: TheMrMilchmann/setup-msvc-dev@v3
with:
arch: x86
- name: Install Conan
id: conan
uses: turtlebrowser/get-conan@main
- name: Cache Conan
uses: actions/cache@v3
with:
key: conan-windows-x86-${{ hashFiles('conanfile.py') }}
path: |
~/.conan2/p
- name: Init conan
run: conan profile detect
- name: Install dependencies
shell: cmd
run: conan install . -of build -s build_type=Release -s:h arch=x86 -o *:shared=False --build=missing
- name: Build
shell: cmd
working-directory: ./build
run: .\conanbuild.bat && cmake .. -DCMAKE_GENERATOR_PLATFORM=x86 -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DBUILD_SHARED_LIBS=1 && cmake --build . --config Release
- name: Create archive
working-directory: ./build
run: |
New-Item -ItemType Directory -Path include/bncsutil -Force | Out-Null
Copy-Item -Path '../src/bncsutil/*.h' -Destination include/bncsutil
Compress-Archive -Path Release/* -DestinationPath bncsutil_${{ github.ref_name }}_x86_dll.zip
Compress-Archive -Path include -DestinationPath "bncsutil_${{ github.ref_name }}_x86_dll.zip" -Update
- uses: actions/upload-artifact@v4
with:
retention-days: 1
overwrite: true
name: bncsutil_${{ github.ref_name }}_x86_dll.zip
path: build/bncsutil_${{ github.ref_name }}_x86_dll.zip
release:
needs: [deb, rpm, dll_amd64, dll_x86]
runs-on: ubuntu-latest
steps:
- name: Download deb
uses: actions/download-artifact@v4
with:
name: libbncsutil-dev_${{ github.ref_name }}_amd64.deb
- name: Download rpm
uses: actions/download-artifact@v4
with:
name: libbncsutil-devel-${{ github.ref_name }}.x86_64.rpm
- name: Download dll amd64
uses: actions/download-artifact@v4
with:
name: bncsutil_${{ github.ref_name }}_amd64_dll.zip
- name: Download dll x86
uses: actions/download-artifact@v4
with:
name: bncsutil_${{ github.ref_name }}_x86_dll.zip
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
files: |
libbncsutil-dev_${{ github.ref_name }}_amd64.deb
libbncsutil-devel-${{ github.ref_name }}.x86_64.rpm
bncsutil_${{ github.ref_name }}_amd64_dll.zip
bncsutil_${{ github.ref_name }}_x86_dll.zip
tag_name: ${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}