Skip to content

Commit 5a89e70

Browse files
committed
libseccomp: create workflow to monitor releases
Create a new github workflow to monitor releases daily from the libseccomp repository. When a new release is detected, lodge an issue against the Firecracker repo. Signed-off-by: James Curtis <[email protected]>
1 parent fa2627a commit 5a89e70

File tree

2 files changed

+71
-1
lines changed

2 files changed

+71
-1
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Monitor libseccomp Releases
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *' # Daily at midnight UTC
6+
workflow_dispatch: # Allow manual trigger
7+
8+
permissions:
9+
issues: write
10+
contents: read
11+
12+
jobs:
13+
check-release:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Get current libseccomp version from Dockerfile
20+
id: current
21+
run: |
22+
CURRENT=$(grep 'LIBSECCOMP_VER' tools/devctr/Dockerfile | grep -oP "v[0-9.]+")
23+
echo "version=$CURRENT" >> $GITHUB_OUTPUT
24+
25+
- name: Check for new libseccomp release
26+
id: latest
27+
run: |
28+
LATEST=$(curl -s https://api.github.com/repos/seccomp/libseccomp/releases/latest | jq -r '.tag_name')
29+
echo "version=$LATEST" >> $GITHUB_OUTPUT
30+
31+
- name: Check latest version is newer
32+
id: semver_check
33+
run: |
34+
CURRENT=$(echo ${{ steps.current.outputs.version }} | grep -oP "[0-9.]+")
35+
LATEST=$(echo ${{ steps.latest.outputs.version }} | grep -oP "[0-9.]+")
36+
if ! printf '%s\n%s' "$LATEST" "$CURRENT" | sort -VC && [ "$CURRENT" != "$LATEST" ]; then
37+
echo "is_newer=true" >> $GITHUB_OUTPUT;
38+
else
39+
echo "is_newer=false" >> $GITHUB_OUTPUT;
40+
fi
41+
42+
- name: Check if issue exists
43+
if: steps.semver_check.outputs.is_newer == 'true' # New release has higher semantic version
44+
id: issue_check
45+
run: |
46+
ISSUES=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
47+
"https://api.github.com/repos/${{ github.repository }}/issues?state=open&labels=dependencies" | \
48+
jq -r --arg tag "${{ steps.latest.outputs.version }}" '[.[] | select(.title | contains("chore(deps): update libseccomp to \($tag)"))] | length')
49+
echo "exists=$ISSUES" >> $GITHUB_OUTPUT
50+
51+
- name: Create issue for new release
52+
id: create_issue
53+
if: steps.semver_check.outputs.is_newer == 'true' && steps.issue_check.outputs.exists == '0' # No existing issue for new version
54+
run: |
55+
gh issue create \
56+
--title "chore(deps): update libseccomp to ${{ steps.latest.outputs.version }}" \
57+
--body "$(cat <<EOF
58+
A new version of libseccomp has been released: **${{ steps.latest.outputs.version }}**
59+
60+
Current version in Dockerfile: **${{ steps.current.outputs.version }}**
61+
62+
Repository: https://github.com/seccomp/libseccomp/releases/tag/${{ steps.latest.outputs.version }}
63+
64+
Please review and consider updating Firecracker's dependency in \`tools/devctr/Dockerfile\`.
65+
EOF
66+
)" \
67+
--label "dependencies"
68+
env:
69+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

tools/devctr/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ ENV LC_ALL=C.UTF-8
1717
ENV QEMU_VER="8.1.1"
1818
ENV CROSVM_VER="9d542e6dafa3a85acd1fb6cd6f1adfa1331c4e96"
1919
ENV CROSVM_TOOLCHAIN_VER="1.68.2"
20+
ENV LIBSECCOMP_VER = "v2.5.5"
2021

2122
# Build and install Qemu vhost-user-blk backend
2223
#
@@ -168,7 +169,7 @@ RUN apt-get update \
168169
libtool gperf \
169170
&& git clone https://github.com/seccomp/libseccomp /tmp/libseccomp \
170171
&& cd /tmp/libseccomp \
171-
&& git checkout tags/v2.5.5 \
172+
&& git checkout tags/${LIBSECCOMP_VER} \
172173
&& ./autogen.sh \
173174
&& CC="musl-gcc -static" ./configure --enable-static=yes --enable-shared=false \
174175
&& make install \

0 commit comments

Comments
 (0)