subsurface/.github/workflows/ubuntu-launchpad-build.yml
Dirk Hohndel 62477d8c65 Complete redesign of Subsurface version numbers
- for now all versions start with v6.0
- CICD builds use the monolithic build number as patch level, e.g. v6.0.12345
- local builds use the following algorithm
  - find the newest commit with a CICD build number that is included in the
    working tree
  - count the number of commits in the working tree since that commit
  - if there are no commits since the last CICD build, the local build version
    will be v6.0.12345-local
  - if there are N commits since the last CICD build, it will be
    v6.0.12345-N-local
- test builds in the CICD that don't create artifacts simply use a dummy release
  in order to not incorrectly increment the build number and also not to waste
  time and resources by manually checking out the nightly-build repo for each of
  these builds.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-01-06 10:55:24 -08:00

62 lines
2 KiB
YAML

name: Ubuntu Launchpad Build
on:
push:
branches:
- master
jobs:
push-to-ppa:
name: Submit build to Ubuntu Launchpad
runs-on: ubuntu-latest
steps:
- name: Check out sources
uses: actions/checkout@v1
- name: atomically create or retrieve the build number
id: version_number
if: github.event_name == 'push'
run: |
cd .. # check out parallel to subsurface sources
url="https://subsurface:${{ secrets.NIGHTLY_BUILDS }}@github.com/subsurface/nightly-builds"
# the clone followed by the pointless push should verify that the password is stored in the config
# that way the script doesn't need the password
git clone -b main https://github.com/subsurface/nightly-builds
cd nightly-builds
git remote set-url origin "$url"
git push origin main
cd ..
bash -x subsurface/scripts/get-or-create-build-nr.sh ${{ github.sha }}
cp nightly-builds/latest-subsurface-buildnumber subsurface
echo "CICD-release" > subsurface/latest-subsurface-buildnumber-extension
version=$(bash subsurface/scripts/get-version)
echo "version=$version" >> $GITHUB_OUTPUT
- name: Setup build dependencies
run: |
sudo apt-get update
sudo apt-get install -y devscripts dput gpg debhelper qt5-qmake cmake
- name: Setup gpg key token for launchpad
env:
GPG_PRIVATE_KEY: ${{ secrets.PPA_SECRET_KEY }}
run: |
echo "$GPG_PRIVATE_KEY" > ~/.key
gpg --import ~/.key
- name: setup git
run: |
git config --global --add safe.directory /__w/subsurface/subsurface
git config --global --add safe.directory /__w/subsurface/subsurface/libdivecomputer
- name: Checkout googlemaps
run: |
cd ..
git clone https://github.com/subsurface/googlemaps
- name: run the launchpad make-package script
run: |
cd ..
bash -x subsurface/packaging/ubuntu/make-package.sh post