enable creating current releases for Ubuntu and Fedora

While for the other platforms we can simply copy our binaries (maybe
after signing them), for Fedora and Ubuntu we have to trigger fresh
builds.

The most logical way that I could think of to do this was to push the
same commit corresponding with the intended current release into a
branch named 'current' and have that trigger Copr and Launchpad builds
that post into our release repos.

So 'master' keeps moving forward, keeps creating new build numbers.
At some point we pick a build number that we want to be the next
'current' release. We then update the current branch to the commit that
corresponds to that build number and push the current branch which
triggers new builds in the correct repos on Copr and Launchpad.

This commit removes the silly 'push' argument from the make-package
scripts (after all, they are used to push those packages to the
respective build services) and instead use the branch name as argument
to those scripts - allowing us to pick which repo to push into.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2024-01-27 16:28:15 -08:00
parent 4fdaf3e8de
commit 21095b18fc
4 changed files with 23 additions and 28 deletions

View file

@ -5,6 +5,7 @@ on:
- scripts/docker/** - scripts/docker/**
branches: branches:
- master - master
- current
jobs: jobs:
setup-build: setup-build:
@ -52,5 +53,5 @@ jobs:
- name: run the copr build script - name: run the copr build script
run: | run: |
cd .. cd ..
bash -x subsurface/packaging/copr/make-package.sh post bash -x subsurface/packaging/copr/make-package.sh ${{ github.refname }}

View file

@ -5,6 +5,7 @@ on:
- scripts/docker/** - scripts/docker/**
branches: branches:
- master - master
- current
jobs: jobs:
push-to-ppa: push-to-ppa:
@ -47,5 +48,5 @@ jobs:
- name: run the launchpad make-package script - name: run the launchpad make-package script
run: | run: |
cd .. cd ..
bash -x subsurface/packaging/ubuntu/make-package.sh post bash -x subsurface/packaging/ubuntu/make-package.sh ${{ github.ref_name }}

View file

@ -70,22 +70,18 @@ fi
# file, this is hard coded to 1 - it's entirely possible that there will be use cases where we # file, this is hard coded to 1 - it's entirely possible that there will be use cases where we
# need to push additional versions... but it seems impossible to predict what exactly would drive # need to push additional versions... but it seems impossible to predict what exactly would drive
# those and how to automate them # those and how to automate them
if [[ "$1" = "post" ]] ; then if [[ "$1" = "current" ]] ; then
# daily vs. release # this is a release
if [[ "$GITREVISION" == "" ]] ; then REPO="Subsurface"
# this is a release SUMMARY="official Fedora RPMs from the Subsurface project"
echo "RELEASE PROCESS IS NOT WELL TESTED" DESCRIPTION="This is the current (or roughly 'weekly') Subsurface release build, provided by the Subsurface team, including our own custom libdivecomputer."
REPO="Subsurface" else
SUMMARY="official Fedora RPMs from the Subsurface project" REPO="Subsurface-test"
DESCRIPTION="This is the official Subsurface build, provided by the Subsurface team, including our own custom libdivecomputer." SUMMARY="rolling build of the latest development version of Subsurface"
else DESCRIPTION="This is a 'daily' build of Subsurface, provided by the Subsurface team, based on the latest sources. The builds aren't always well tested."
REPO="Subsurface-test"
SUMMARY="rolling build of the latest development version of Subsurface"
DESCRIPTION="This is a 'daily' build of Subsurface, provided by the Subsurface team, based on the latest sources. The builds aren't always well tested."
fi
cd "$HOME"/rpmbuild
# shellcheck disable=SC2002
cat "$TOPDIR"/subsurface/packaging/copr/subsurface.spec | sed "s/%define latestVersion.*/%define latestVersion $GITVERSION/;s/DESCRIPTION/$DESCRIPTION/;s/SUMMARY/$SUMMARY/" > SPECS/subsurface.spec
rpmbuild --verbose -bs "$(pwd)/SPECS/subsurface.spec"
copr build --nowait $REPO "$(pwd)/SRPMS/subsurface-$GITVERSION"-1.fc*.src.rpm
fi fi
cd "$HOME"/rpmbuild
# shellcheck disable=SC2002
cat "$TOPDIR"/subsurface/packaging/copr/subsurface.spec | sed "s/%define latestVersion.*/%define latestVersion $GITVERSION/;s/DESCRIPTION/$DESCRIPTION/;s/SUMMARY/$SUMMARY/" > SPECS/subsurface.spec
rpmbuild --verbose -bs "$(pwd)/SPECS/subsurface.spec"
copr build --nowait $REPO "$(pwd)/SRPMS/subsurface-$GITVERSION"-1.fc*.src.rpm

View file

@ -118,12 +118,9 @@ fi
cd .. cd ..
if [[ "$1" = "post" ]] ; then if [[ "$1" = "current" ]] ; then
# daily vs. release # this is a current release
if [[ "$GITREVISION" == "" ]] ; then dput ppa:subsurface/subsurface "$FOLDER-$rev"~*.changes
# this is a release else
dput ppa:subsurface/subsurface "$FOLDER-$rev"~*.changes dput ppa:subsurface/subsurface-daily "$FOLDER-$rev"~*.changes
else
dput ppa:subsurface/subsurface-daily "$FOLDER-$rev"~*.changes
fi
fi fi