Skip to content

Commit 70c6e32

Browse files
committed
packages: add rpm/deb packages creation
Added pipeline for rpm/dep packages publication when new tag is created. It includes scripts to update changelogs for packages with new release notes from CHANGELOG.md. In case the changelog update was missed github job will add latest release in packages automatically, but not commit them to the branch, so later these changes must be commited manually. Closes TNTP-6408
1 parent 536f0b0 commit 70c6e32

12 files changed

Lines changed: 347 additions & 0 deletions

.github/workflows/packaging.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: packaging
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
push:
7+
branches:
8+
- 'master'
9+
tags:
10+
- '*'
11+
12+
jobs:
13+
version-check:
14+
# We need this job to run only on push with tag.
15+
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
16+
runs-on: ubuntu-24.04
17+
steps:
18+
- name: Check module version for api
19+
uses: tarantool/actions/check-module-version@master
20+
with:
21+
module-name: 'sharded_queue.api'
22+
- name: Check module version for storage
23+
uses: tarantool/actions/check-module-version@master
24+
with:
25+
module-name: 'sharded_queue.storage'
26+
27+
package:
28+
runs-on: ubuntu-24.04
29+
needs: version-check
30+
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
platform:
35+
- { os: 'debian', dist: 'stretch' }
36+
- { os: 'debian', dist: 'bullseye' }
37+
- { os: 'ubuntu', dist: 'xenial' }
38+
- { os: 'ubuntu', dist: 'bionic' }
39+
- { os: 'ubuntu', dist: 'focal' }
40+
- { os: 'ubuntu', dist: 'groovy' }
41+
- { os: 'ubuntu', dist: 'jammy' }
42+
43+
env:
44+
OS: ${{ matrix.platform.os }}
45+
DIST: ${{ matrix.platform.dist }}
46+
RPM_SPEC: rpm/sharded-queue.spec
47+
48+
steps:
49+
- name: Clone the module
50+
uses: actions/checkout@v4
51+
# `actions/checkout` performs shallow clone of repo. To provide
52+
# proper version of the package to `packpack` we need to have
53+
# complete repository, otherwise it will be `0.0.1`.
54+
with:
55+
fetch-depth: 0
56+
57+
- name: Clone the packpack tool
58+
uses: actions/checkout@v4
59+
with:
60+
repository: packpack/packpack
61+
path: packpack
62+
63+
- name: Fetch tags
64+
# Found that Github checkout Actions pulls all the tags, but
65+
# right it deannotates the testing tag, check:
66+
# https://github.com/actions/checkout/issues/290
67+
# But we use 'git describe ..' calls w/o '--tags' flag and it
68+
# prevents us from getting the needed tag for packages version
69+
# setup. To avoid of it, let's fetch it manually, to be sure
70+
# that all tags will exist always.
71+
run: git fetch --tags -f
72+
73+
- name: Check packages changelog
74+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
75+
run: |
76+
./debian/update_debian_changelog.sh "${GITHUB_REF#refs/tags/}"
77+
./rpm/update_rpm_changelog.sh "${GITHUB_REF#refs/tags/}"
78+
79+
- name: Create packages
80+
run: ./packpack/packpack
81+
82+
- name: Deploy packages
83+
# We need this step to run only on push with tag.
84+
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
85+
env:
86+
RWS_URL_PART: https://rws.tarantool.org/tarantool-modules
87+
RWS_AUTH: ${{ secrets.RWS_AUTH }}
88+
PRODUCT_NAME: sharded-queue
89+
working-directory: build
90+
run: |
91+
CURL_CMD="curl -LfsS \
92+
-X PUT ${RWS_URL_PART}/${OS}/${DIST} \
93+
-u ${RWS_AUTH} \
94+
-F product=${PRODUCT_NAME}"
95+
96+
shopt -s nullglob
97+
for f in *.deb *.rpm *.dsc *.tar.xz *.tar.gz; do
98+
CURL_CMD+=" -F $(basename ${f})=@${f}"
99+
done
100+
101+
echo ${CURL_CMD}
102+
103+
${CURL_CMD}

debian/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
sharded-queue/
2+
files
3+
*stamp*
4+
*.substvars
5+
*.log

debian/changelog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
sharded-queue (1.0.0-1) unstable; urgency=medium
2+
3+
* Initial release
4+
5+
-- Oleg Jukovec <oleg.jukovec@tarantool.org> Tue, 17 Feb 2026 12:00:00 +0300

debian/control

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Source: sharded-queue
2+
Priority: optional
3+
Section: database
4+
Maintainer: Oleg Jukovec <oleg.jukovec@tarantool.org>
5+
Build-Depends: debhelper-compat (= 13),
6+
tarantool (>= 3.0.2.0),
7+
Standards-Version: 3.9.6
8+
Homepage: https://github.com/tarantool/sharded-queue
9+
Vcs-Git: git://github.com/tarantool/sharded-queue.git
10+
Vcs-Browser: https://github.com/tarantool/sharded-queue
11+
12+
Package: sharded-queue
13+
Architecture: all
14+
Depends: tarantool (>= 3.0.2.0), ${misc:Depends}
15+
Description: Tarantool Sharded Queue Application
16+
This module provides roles for the Tarantool 3 and for the Tarantool Cartridge
17+
implementing of a distributed queue compatible with Tarantool queue (fifiottl driver).

debian/copyright

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2+
Debianized-By: Oleg Jukovec <oleg.jukovec@tarantool.org>
3+
Upstream-Name: sharded-queue
4+
Upstream-Contact: support@tarantool.org
5+
Source: https://github.com/tarantool/sharded-queue
6+
7+
Files: *
8+
Copyright: 2014-2021 Tarantool AUTHORS
9+
License: BSD-2-Clause
10+
Redistribution and use in source and binary forms, with or without
11+
modification, are permitted provided that the following conditions
12+
are met:
13+
1. Redistributions of source code must retain the above copyright
14+
notice, this list of conditions and the following disclaimer.
15+
2. Redistributions in binary form must reproduce the above copyright
16+
notice, this list of conditions and the following disclaimer in the
17+
documentation and/or other materials provided with the distribution.
18+
.
19+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
20+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22+
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
23+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25+
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28+
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29+
SUCH DAMAGE.

debian/prebuild.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
set -exu # Strict shell (w/o -o pipefail)
4+
5+
curl -LsSf https://www.tarantool.io/release/3/installer.sh | sudo bash

debian/rules

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/make -f
2+
3+
%:
4+
dh $@
5+
6+
override_dh_auto_build:
7+
8+
9+
override_dh_auto_test:
10+
DEB_BUILD_OPTIONS=nocheck dh_auto_test

debian/sharded-queue.install

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
sharded_queue usr/share/tarantool/
2+
roles usr/share/tarantool/
3+
init.lua usr/share/tarantool/

debian/update_debian_changelog.sh

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/bin/bash
2+
set -e
3+
4+
CHANGELOG_MD="CHANGELOG.md"
5+
DEBIAN_CHANGELOG="debian/changelog"
6+
PACKAGE_NAME="sharded-queue"
7+
MAINTAINER="Oleg Jukovec <oleg.jukovec@tarantool.org>"
8+
9+
VERSION="$1"
10+
if [ -z "$VERSION" ]; then
11+
echo "Error: Version is required. Usage: $0 <version>"
12+
exit 1
13+
fi
14+
VERSION="${VERSION#v}"
15+
16+
if grep -q "^$PACKAGE_NAME ($VERSION-1) " "$DEBIAN_CHANGELOG" 2>/dev/null; then
17+
echo "Entry for version $VERSION already exists in $DEBIAN_CHANGELOG. Nothing to do."
18+
exit 0
19+
fi
20+
21+
echo "Updating debian/changelog for version $VERSION from $CHANGELOG_MD"
22+
23+
# Get a corresponding release note from CHANGELOG.md.
24+
SECTION=$(awk -v ver="$VERSION" '
25+
BEGIN { gsub(/\./, "\\.", ver) }
26+
$0 ~ "^## " ver " " {flag=1; next}
27+
/^## / {flag=0}
28+
flag {print}
29+
' "$CHANGELOG_MD" | sed -e '/./,$!d' -e ':a;N;$!ba;s/\n*$//')
30+
31+
if [ -z "$SECTION" ]; then
32+
echo "Warning: No section found for version $VERSION in $CHANGELOG_MD. Aborting."
33+
exit 1
34+
fi
35+
36+
# Convert release note to the debian format.
37+
DEBIAN_ENTRIES=$(echo "$SECTION" | awk '
38+
/^[-*] / {
39+
sub(/^[-*] /, " * ");
40+
print;
41+
next;
42+
}
43+
/^[A-Za-z]/ { print " " $0; next }
44+
')
45+
46+
TMP_FILE=$(mktemp)
47+
cat > "$TMP_FILE" <<EOF
48+
$PACKAGE_NAME ($VERSION-1) unstable; urgency=medium
49+
50+
$DEBIAN_ENTRIES
51+
52+
-- $MAINTAINER $(date -R)
53+
54+
EOF
55+
56+
cat "$TMP_FILE" "$DEBIAN_CHANGELOG" > "${DEBIAN_CHANGELOG}.new"
57+
mv "${DEBIAN_CHANGELOG}.new" "$DEBIAN_CHANGELOG"
58+
59+
rm -f "$TMP_FILE"
60+
echo "debian/changelog was automatically updated for version $VERSION."

rpm/prebuild.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
set -exu # Strict shell (w/o -o pipefail)
4+
5+
curl -LsSf https://www.tarantool.io/release/3/installer.sh | sudo bash

0 commit comments

Comments
 (0)