-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·52 lines (38 loc) · 1.39 KB
/
build.sh
File metadata and controls
executable file
·52 lines (38 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env bash
set -e
ARCH="${ARCH:-amd64}"
DIST="${DIST:-bookworm}"
BUILDAREA="${BUILDAREA:-/tmp/nginx-config-reloader-build}"
BUILDPATH="${BUILDAREA}-${DIST}"
BRANCH="master"
if [ "$(git rev-parse --abbrev-ref HEAD)" != $BRANCH ]; then
echo "You are not on the $BRANCH branch, aborting"
exit 1
fi;
export VERSION=$(date "+%Y%m%d.%H%M%S")
echo "Updating project to version $VERSION"
git add pyproject.toml uv.lock
echo "Committing version update"
git commit pyproject.toml uv.lock -m "Update project version to $VERSION"
echo "Generating changelog changelog"
gbp dch --debian-tag="%(version)s" --new-version=$VERSION --debian-branch $BRANCH --release --commit
echo "Building package for $DIST"
git checkout $BRANCH
TEMPBRANCH="$BRANCH-build-$DIST-$VERSION"
git checkout -b $TEMPBRANCH
mkdir -p $BUILDPATH
gbp buildpackage --git-pbuilder --git-export-dir=$BUILDPATH --git-dist=$DIST --git-arch=$ARCH \
--git-debian-branch=$TEMPBRANCH --git-ignore-new
git checkout $BRANCH
git branch -D $TEMPBRANCH
echo
echo "*************************************************************"
echo
echo "Creating tag $VERSION"
git tag $VERSION
echo
echo "*************************************************************"
echo "Package built succesfully!"
echo "--> ${BUILDPATH}/nginx-config-reloader_${VERSION}_all.deb"
echo "Now push the commit with the version update and the tag:"
echo "git push; git push --tags"