Skip to content

Commit 12c8e6d

Browse files
author
Nagendra Puthane
committed
ci: build devel packages of dpdk
Start building devel DPDK packages. Signed-off-by: Nagendra Puthane <ntp@marvell.com>
1 parent 3294cb0 commit 12c8e6d

File tree

1 file changed

+65
-8
lines changed

1 file changed

+65
-8
lines changed

.github/workflows/build-cn10k.yml

Lines changed: 65 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
name: build-cn10k
22

33
on:
4+
workflow_dispatch:
45
push:
6+
tags:
7+
- '[0-9][0-9].[0-9][0-9].0'
58
schedule:
69
- cron: "0 0 * * 1"
710

@@ -10,28 +13,83 @@ permissions:
1013
id-token: write
1114
packages: write
1215

16+
env:
17+
COMPONENT: dpdk
18+
1319
jobs:
1420
ubuntu-cn10k-build:
1521
name: ubuntu-cn10k-arm64
1622
runs-on: ubuntu-24.04-arm
23+
1724
steps:
1825
- name: Checkout sources
19-
uses: actions/checkout@v4
26+
uses: actions/checkout@v4.2.2
27+
with:
28+
fetch-depth: 0
29+
2030
- name: Generate cache keys
2131
id: get_ref_keys
2232
run: |
23-
echo 'ccache=ccache-'$(date -u +%Y-m%M) >> $GITHUB_OUTPUT
33+
echo 'ccache=ccache-'$(date -u +%Y-%m) >> $GITHUB_OUTPUT
2434
- name: Retrieve ccache cache
25-
uses: actions/cache@v4
35+
uses: actions/cache@v4.2.3
2636
with:
2737
path: ~/.ccache
2838
key: ${{ steps.get_ref_keys.outputs.ccache }}-${{ github.ref }}
2939
restore-keys: |
3040
${{ steps.get_ref_keys.outputs.ccache }}-refs/heads/main
41+
42+
- name: Extract version details
43+
id: version
44+
run: |
45+
set -x
46+
mkdir -p "${PWD}/artifacts"
47+
git fetch --tags --quiet
48+
49+
EVENT="${{ github.event_name }}"
50+
51+
BASE=$(cut -d. -f1,2 < MRVL_VERSION)
52+
53+
if [ "$EVENT" = "push" ]; then
54+
MINOR=0
55+
PKG_POSTFIX=""
56+
IS_DEVEL=false
57+
else
58+
LAST=$(git tag -l "${COMPONENT}-${BASE}.*" | sort -V | tail -n1)
59+
if [ -z "$LAST" ]; then MINOR=0 ; else
60+
MINOR=$(echo "$LAST" | awk -F. '{print $3}')
61+
MINOR=$((MINOR+1))
62+
fi
63+
PKG_POSTFIX="-devel"
64+
IS_DEVEL=true
65+
fi
66+
67+
MRVL_PKG_VERSION="${BASE}.${MINOR}"
68+
69+
{
70+
echo "MRVL_PKG_VERSION=${MRVL_PKG_VERSION}"
71+
echo "PKG_POSTFIX=${PKG_POSTFIX}"
72+
echo "IS_DEVEL=${IS_DEVEL}"
73+
echo "COMPONENT=${COMPONENT}"
74+
} >> artifacts/env
75+
76+
- name: push component patch tag
77+
if: github.event_name == 'workflow_dispatch'
78+
run: |
79+
set -x
80+
source artifacts/env
81+
NEWTAG="${COMPONENT}-${MRVL_PKG_VERSION}"
82+
git config user.name "github-bot-accelerator"
83+
git config user.email "github-bot-accelerator@marvell.com"
84+
git tag -l "$NEWTAG" | grep -q . || git tag -a "$NEWTAG" -m "devel bump $NEWTAG"
85+
git push origin "$NEWTAG"
86+
3187
- name: Build DPDK and generate package
3288
id: build
3389
run: |
34-
mkdir -p "${PWD}/artifacts"
90+
set -x
91+
export DEBIAN_FRONTEND=noninteractive
92+
source artifacts/env
3593
mkdir -p ~/.ccache
3694
sudo apt-get update -q -y
3795
sudo apt-get install -y build-essential ccache git software-properties-common
@@ -48,7 +106,6 @@ jobs:
48106
sed -i "s/prefix=.*/prefix=/g" "${PWD}/install/lib/aarch64-linux-gnu/pkgconfig/libdpdk.pc"
49107
sed -i "s/prefix=.*/prefix=/g" "${PWD}/install/lib/aarch64-linux-gnu/pkgconfig/libdpdk-libs.pc"
50108
PKG_VERSION_NAME=`cat VERSION | awk -F'.' '{print $1"."$2}'`
51-
MRVL_PKG_VERSION=`cat MRVL_VERSION`
52109
DISTRO=ubuntu-`lsb_release -rs`
53110
mkdir -p "${PWD}/install/debian"
54111
mkdir -p "${PWD}/install/DEBIAN"
@@ -88,21 +145,21 @@ jobs:
88145
echo "DISTRO=${DISTRO}" >> "$GITHUB_OUTPUT"
89146
- name: Upload debian package as artifact
90147
uses: actions/upload-artifact@v4.3.1
91-
if: ${{ github.event_name == 'push' }}
148+
if: ${{ github.event_name == 'push' }} || ${{ github.event_name == 'workflow_dispatch' }}
92149
with:
93150
name: dpdk-${{ steps.artifacts.outputs.PKG_VERSION_NAME }}-cn10k${{ steps.artifacts.outputs.PKG_POSTFIX }}_${{ steps.artifacts.outputs.MRVL_PKG_VERSION }}_arm64.deb
94151
path: ${{ github.workspace }}/artifacts/dpdk-${{ steps.artifacts.outputs.PKG_VERSION_NAME }}-cn10k${{ steps.artifacts.outputs.PKG_POSTFIX }}_${{ steps.artifacts.outputs.MRVL_PKG_VERSION }}_arm64.deb
95152
- name: Delete existing release
96153
uses: liudonghua123/delete-release-action@v1
97-
if: ${{ github.event_name == 'push' }}
154+
if: ${{ github.event_name == 'push' }} || ${{ github.event_name == 'workflow_dispatch' }}
98155
env:
99156
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
100157
with:
101158
release_name: dpdk-cn10k-${{ steps.artifacts.outputs.PKG_VERSION_NAME }}_${{ steps.artifacts.outputs.MRVL_PKG_VERSION }}-${{ steps.artifacts.outputs.DISTRO }}-${{ steps.artifacts.outputs.TAG }}
102159
suppress_errors: true
103160
- name: Release DPDK cn10k package
104161
uses: softprops/action-gh-release@v2.0.4
105-
if: ${{ github.event_name == 'push' }}
162+
if: ${{ github.event_name == 'push' }} || ${{ github.event_name == 'workflow_dispatch' }}
106163
with:
107164
tag_name: dpdk-cn10k-${{ steps.artifacts.outputs.PKG_VERSION_NAME }}_${{ steps.artifacts.outputs.MRVL_PKG_VERSION }}-${{ steps.artifacts.outputs.DISTRO }}-${{ steps.artifacts.outputs.TAG }}
108165
files: |

0 commit comments

Comments
 (0)