Skip to content

Commit

Permalink
Merge pull request #19 from cen1/feature/packaging
Browse files Browse the repository at this point in the history
Feature/packaging
  • Loading branch information
carlbennett authored Feb 24, 2024
2 parents cd4f2fc + b255fd3 commit dc4e375
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 11 deletions.
69 changes: 58 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ env:

jobs:
deb:
if: true
runs-on: ubuntu-latest
container:
image: debian:bookworm
Expand All @@ -30,16 +31,17 @@ jobs:
id: package
working-directory: build
run: |
cpack -G "DEB" -D CPACK_PACKAGE_FILE_NAME=libbncsutil-${{ github.ref_name }}-devel
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-${{ github.ref_name }}-devel.deb
path: build/libbncsutil-${{ github.ref_name }}-devel.deb
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
Expand All @@ -58,36 +60,81 @@ jobs:

- name: Package
working-directory: build
run: cpack -G "RPM" -D CPACK_PACKAGE_FILE_NAME=libbncsutil-${{ github.ref_name }}-devel
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-${{ github.ref_name }}-devel.rpm
path: build/libbncsutil-${{ github.ref_name }}-devel.rpm
name: libbncsutil-devel-${{ github.ref_name }}.x86_64.rpm
path: build/libbncsutil-devel-${{ github.ref_name }}.x86_64.rpm

dll:
if: true
runs-on: windows-latest

steps:
- uses: actions/checkout@v4

- uses: TheMrMilchmann/setup-msvc-dev@v3
with:
arch: x64

- 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: Compress-Archive -Path Release/* -Destination bncsutil_${{ github.ref_name }}_amd64_dll.zip

- 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


release:
needs: [deb, rpm]
needs: [deb, rpm, dll]
runs-on: ubuntu-latest

steps:
- name: Download deb
uses: actions/download-artifact@v4
with:
name: libbncsutil-${{ github.ref_name }}-devel.deb
name: libbncsutil-dev_${{ github.ref_name }}_amd64.deb

- name: Download rpm
uses: actions/download-artifact@v4
with:
name: libbncsutil-${{ github.ref_name }}-devel.rpm
name: libbncsutil-devel-${{ github.ref_name }}.x86_64.rpm

- name: Download dll
uses: actions/download-artifact@v4
with:
name: bncsutil_${{ github.ref_name }}_amd64_dll.zip

- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
files: |
libbncsutil-${{ github.ref_name }}-devel.deb
libbncsutil-${{ github.ref_name }}-devel.rpm
libbncsutil-dev_${{ github.ref_name }}_amd64.deb
libbncsutil-devel-${{ github.ref_name }}.x86_64.rpm
bncsutil_${{ github.ref_name }}_amd64_dll.zip
tag_name: ${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,5 @@ conanbuildinfo.txt
conaninfo.txt
graph_info.json
CMakeUserPresets.json
cmake-*
.idea/

0 comments on commit dc4e375

Please sign in to comment.