Skip to content

Commit

Permalink
ci: build debian packages on push release tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Timur Aitov authored and taitov committed Jan 24, 2024
1 parent 3f08381 commit 9ef74fb
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 0 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Release

on:
push:
tags:
- 'v[0-9]+.[0-9]+'

jobs:
build-debian-package-ubuntu22.04:
name: build (Ubuntu 22.04)
runs-on: builder
container:
image: yanetplatform/builder
steps:
- uses: actions/checkout@v3
- run: |
export YANET_VERSION=${{github.ref_name}}
export YANET_VERSION=${YANET_VERSION:1}
export YANET_VERSION_MAJOR=${YANET_VERSION%.*}
export YANET_VERSION_MINOR=${YANET_VERSION#*.}
export YANET_VERSION_REVISION=${{github.run_number}}
export YANET_VERSION_HASH=${{github.sha}}
export YANET_VERSION_CUSTOM=stable
meson setup --prefix=/target \
-Dtarget=release \
-Dyanet_config=release,l3balancer,firewall \
-Darch=corei7,broadwell,knl \
-Dversion_major=$YANET_VERSION_MAJOR \
-Dversion_minor=$YANET_VERSION_MINOR \
-Dversion_revision=$YANET_VERSION_REVISION \
-Dversion_hash=$YANET_VERSION_HASH \
-Dversion_custom=$YANET_VERSION_CUSTOM \
build
meson compile -C build
- run: meson install -C build
- run: |
cp -r debian /target/DEBIAN
sed -i "s/__VERSION__/${YANET_VERSION}/g" /target/DEBIAN/control
- run: |
mkdir /export
dpkg-deb -b "/target" /export/yanet_${YANET_VERSION}_ubuntu22.04.deb
- uses: actions/upload-artifact@v3
with:
name: target_debian
path: /export/yanet*.deb

build-debian-package-ubuntu18.04:
name: build (Ubuntu 18.04)
runs-on: builder
container:
image: yanetplatform/builder_ubuntu18.04
steps:
- uses: actions/checkout@v3
- run: |
export YANET_VERSION=${{github.ref_name}}
export YANET_VERSION=${YANET_VERSION:1}
export YANET_VERSION_MAJOR=${YANET_VERSION%.*}
export YANET_VERSION_MINOR=${YANET_VERSION#*.}
export YANET_VERSION_REVISION=${{github.run_number}}
export YANET_VERSION_HASH=${{github.sha}}
export YANET_VERSION_CUSTOM=stable
meson setup --prefix=/target \
-Dtarget=release \
-Dyanet_config=release,l3balancer,firewall \
-Darch=corei7,broadwell,knl \
-Dversion_major=$YANET_VERSION_MAJOR \
-Dversion_minor=$YANET_VERSION_MINOR \
-Dversion_revision=$YANET_VERSION_REVISION \
-Dversion_hash=$YANET_VERSION_HASH \
-Dversion_custom=$YANET_VERSION_CUSTOM \
build
meson compile -C build
- run: meson install -C build
- run: |
cp -r debian /target/DEBIAN
sed -i "s/__VERSION__/${YANET_VERSION}/g" /target/DEBIAN/control
- run: |
mkdir /export
dpkg-deb -b "/target" /export/yanet_${YANET_VERSION}_ubuntu18.04.deb
- uses: actions/upload-artifact@v3
with:
name: target_debian
path: /export/yanet*.deb
8 changes: 8 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Package: yanet
Version: __VERSION__
Architecture: amd64
Section: net
Maintainer: Timur Aitov <[email protected]>
Homepage: https://github.com/yanet-platform/yanet
Description: Software forwarding traffic based on DPDK
YANET is an open-source extensible framework for software forwarding traffic based on DPDK

0 comments on commit 9ef74fb

Please sign in to comment.