Merge pull request #20 from cen1/feature/clang-tidy #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |