mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 02:15:45 +02:00
feat(actions): add support for debian packaging (#696)
Signed-off-by: Boaz Sade <boaz@dragonflydb.io> Signed-off-by: Boaz Sade <boaz@dragonflydb.io>
This commit is contained in:
parent
9536c0a645
commit
be74fa0a5b
2 changed files with 30 additions and 3 deletions
14
.github/workflows/release.yml
vendored
14
.github/workflows/release.yml
vendored
|
@ -98,18 +98,28 @@ jobs:
|
|||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
- name: Configure
|
||||
run: |
|
||||
apt update && apt install -y debhelper
|
||||
- name: Build artifacts
|
||||
run: |
|
||||
# Work around https://github.com/actions/checkout/issues/766
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
git describe --always --tags ${{ github.sha }}
|
||||
./tools/release.sh
|
||||
# once the build is over, we want to generate a Debian package
|
||||
./tools/packaging/generate_debian_package.sh build-opt/dragonfly-x86_64
|
||||
- name: Save artifacts
|
||||
run: |
|
||||
# place all artifacts at the same location
|
||||
mkdir -p results-artifacts
|
||||
mv build-opt/dragonfly-*tar.gz results-artifacts
|
||||
mv dragonfly_*.deb results-artifacts
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: dragonfly-amd64
|
||||
path: build-opt/dragonfly-*tar.gz
|
||||
|
||||
path: results-artifacts/*
|
||||
publish_release:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build-native, build-qemu]
|
||||
|
|
|
@ -18,9 +18,16 @@ THIS_DIR=$(dirname ${SCRIPT_ABS_PATH})
|
|||
GIT_DIR=$1
|
||||
PACKGE_DIR=${THIS_DIR}/debian
|
||||
CHANGE_LOG=${PACKGE_DIR}/changelog
|
||||
|
||||
cd ${GIT_DIR}
|
||||
git config --global --add safe.directory ${GIT_DIR}
|
||||
has_tags=$(git tag -l v* | wc -l 2>/dev/null)
|
||||
if [ "$has_tags" = "" -o "$has_tags" = "0" ]; then
|
||||
git fetch --all --tags || {
|
||||
echo "failed to fetch tags, cannot build changelog file"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
|
||||
>${CHANGE_LOG}
|
||||
prevtag=v0.2.0
|
||||
pkgname=`cat ${PACKGE_DIR}/control | grep '^Package: ' | sed 's/^Package: //'`
|
||||
|
@ -28,3 +35,13 @@ git tag -l v* | sort -V | while read tag; do
|
|||
(echo "$pkgname (${tag#v}) unstable; urgency=low"; git log --pretty=format:' * %s' $prevtag..$tag; git log --pretty='format:%n%n -- %aN <%aE> %aD%n%n' $tag^..$tag) | cat - ${CHANGE_LOG} | sponge ${CHANGE_LOG}
|
||||
prevtag=$tag
|
||||
done
|
||||
if [ -f ${CHANGE_LOG} ]; then
|
||||
haslnes=$(wc -l ${CHANGE_LOG} 2>/dev/null | awk '{print $1}')
|
||||
if [ "$haslnes" = "" ]; then
|
||||
echo "empty file ${CHANGE_LOG}, failed to generate changelog"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "failed to generate ${CHANGE_LOG}"
|
||||
exit 1
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue