CICD: Improve Workflows.

Make multiple improvements to the existing workflows:
- create a shared custom action to deal with version number tracking
  and generation;
- use this action to add the branch name to the version for pull
  request builds;
- create a shared workflow for all debian-ish builds to avoid re-use
  by copy / paste;
- remove potential security risks by eliminating the use of
  pre-evaluated expressions (`${{ ... }}`) inside scripts;
- update outdated GitHub action versions;
- improve the consistency by renaming scripts acording to have a `.sh`
  extension;
- improve naming of generated artefacts for pull requests to include
  the correct version.

@dirkh: Unfortunately this is potentially going to break builds when it is
merged, as there is no good way to 'test' a merge build short of
merging.
We'll just have to deal with the fallout of it in a follow-up pull
request.

Signed-off-by: Michael Keller <github@ike.ch>
This commit is contained in:
=Michael Keller 2024-05-11 17:33:54 +12:00 committed by Michael Keller
parent e20ec9248c
commit 6fc8310705
32 changed files with 399 additions and 536 deletions

View file

@ -15,17 +15,17 @@ jobs:
VERSION: ${{ '5.15.2' }} # the version numbers here is based on the Qt version, the third digit is the rev of the docker image
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Build the name for the docker image
id: build_name
run: |
v=${{ env.VERSION }}
b=${{ github.ref }} # -BRANCH suffix, unless the branch is master
v=$VERSION
b=$GITHUB_REF # -BRANCH suffix, unless the branch is master
b=${b/refs\/heads\//}
b=${b,,} # the name needs to be all lower case
if [ $b = "master" ] ; then b="" ; else b="-$b" ; fi
echo "NAME=subsurface/android-build${b}:${v}" >> $GITHUB_OUTPUT
echo "NAME=$GITHUB_REPOSITORY_OWNER/android-build${b}:${v}" >> $GITHUB_OUTPUT
- name: Build and Publish Linux Docker image to Dockerhub
uses: elgohr/Publish-Docker-Github-Action@v5

View file

@ -1,4 +1,5 @@
name: Android
on:
push:
paths-ignore:
@ -11,45 +12,44 @@ on:
branches:
- master
jobs:
buildAndroid:
runs-on: ubuntu-latest
build:
env:
BUILD_ROOT: ${{ github.workspace }}/..
KEYSTORE_FILE: ${{ github.workspace }}/../subsurface.keystore
runs-on: ubuntu-latest
container:
image: docker://subsurface/android-build:5.15.2
steps:
- name: checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: atomically create or retrieve the build number and assemble release notes
- name: set the version information
id: version_number
if: github.event_name == 'push'
run: |
bash scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release"
version=$(cat release-version)
echo "version=$version" >> $GITHUB_OUTPUT
- name: store dummy version and build number for non-push build runs
if: github.event_name != 'push'
run: |
echo "100" > latest-subsurface-buildnumber
echo "CICD-pull-request" > latest-subsurface-buildnumber-extension
uses: ./.github/actions/manage-version
with:
nightly-builds-secret: ${{ secrets.NIGHTLY_BUILDS }}
- name: set up the keystore
if: github.event_name == 'push'
env:
ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
run: |
echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 -d > $KEYSTORE_FILE
echo "$ANDROID_KEYSTORE_BASE64" | base64 -d > $KEYSTORE_FILE
- name: run build
id: build
env:
ANDROID_KEYSTORE_PASSWORD: pass:${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
KEYSTORE_ALIAS: ${{ secrets.ANDROID_KEYSTORE_ALIAS }}
BUILDNR: ${{ steps.version_number.outputs.buildnr }}
run: |
# this is rather awkward, but it allows us to use the preinstalled
# Android and Qt versions with relative paths
cd $BUILD_ROOT
cd ..
ln -s /android/5.15.* .
ln -s /android/build-tools .
ln -s /android/cmdline-tools .
@ -62,12 +62,20 @@ jobs:
git config --global --add safe.directory $GITHUB_WORKSPACE
git config --global --add safe.directory $GITHUB_WORKSPACE/libdivecomputer
# get the build number via curl so this works both for a pull request as well as a push
BUILDNR=$(curl -q https://raw.githubusercontent.com/subsurface/nightly-builds/main/latest-subsurface-buildnumber)
export OUTPUT_DIR="$GITHUB_WORKSPACE"
export KEYSTORE_FILE="$KEYSTORE_FILE"
export KEYSTORE_PASSWORD="pass:${{ secrets.ANDROID_KEYSTORE_PASSWORD }}"
export KEYSTORE_ALIAS="${{ secrets.ANDROID_KEYSTORE_ALIAS }}"
bash -x ./subsurface/packaging/android/qmake-build.sh -buildnr ${BUILDNR}
bash -x ./subsurface/packaging/android/qmake-build.sh -buildnr $BUILDNR
- name: delete the keystore
if: github.event_name == 'push'
run: |
rm $KEYSTORE_FILE
- name: publish pull request artifacts
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: Subsurface-Android-${{ steps.version_number.outputs.version }}
path: Subsurface-mobile-*.apk
# only publish a 'release' on push events (those include merging a PR)
- name: upload binaries
@ -81,8 +89,3 @@ jobs:
fail_on_unmatched_files: true
files: |
Subsurface-mobile-${{ steps.version_number.outputs.version }}.apk
- name: delete the keystore
if: github.event_name == 'push'
run: |
rm $KEYSTORE_FILE

View file

@ -25,15 +25,14 @@ jobs:
matrix:
# Override automatic language detection by changing the below list
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
language: ['cpp', 'javascript']
language: ['c-cpp', 'javascript-typescript']
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
fetch-depth: 0
submodules: recursive
- name: get container ready for build
run: |
@ -51,7 +50,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@ -60,13 +59,11 @@ jobs:
# queries: ./path/to/local/query, your-org/your-repo/queries@main
- name: Build
env:
SUBSURFACE_REPO_PATH: ${{ github.workspace }}
run: |
cd ..
git config --global --add safe.directory ${SUBSURFACE_REPO_PATH}
git config --global --add safe.directory ${SUBSURFACE_REPO_PATH}/libdivecomputer
git config --global --add safe.directory $GITHUB_WORKSPACE
git config --global --add safe.directory $GITHUB_WORKSPACE/libdivecomputer
bash -e -x subsurface/scripts/build.sh -desktop -build-with-webkit
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3

View file

@ -1,4 +1,5 @@
name: Coverity Scan Linux Qt 5.9
on:
schedule:
- cron: '0 18 * * *' # Daily at 18:00 UTC
@ -11,7 +12,10 @@ jobs:
steps:
- name: checkout sources
uses: actions/checkout@v1
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: add build dependencies
run: |
@ -30,11 +34,15 @@ jobs:
qtquickcontrols2-5-dev libbluetooth-dev libmtp-dev
- name: configure environment
env:
SUBSURFACE_REPO_PATH: ${{ github.workspace }}
run: |
git config --global --add safe.directory ${SUBSURFACE_REPO_PATH}
git config --global --add safe.directory ${SUBSURFACE_REPO_PATH}/libdivecomputer
git config --global --add safe.directory $GITHUB_WORKSPACE
git config --global --add safe.directory $GITHUB_WORKSPACE/libdivecomputer
- name: get the version information
id: version_number
uses: ./.github/actions/manage-version
with:
no-increment: true
- name: run coverity scan
uses: vapier/coverity-scan-action@v1
@ -44,5 +52,5 @@ jobs:
email: glance@acc.umu.se
command: subsurface/scripts/build.sh -desktop -build-with-webkit
working-directory: ${{ github.workspace }}/..
version: $(/scripts/get-version)
version: ${{ steps.version_number.outputs.version }}
description: Automatic scan on github actions

View file

@ -26,6 +26,9 @@ jobs:
- name: Checkout Sources
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Process the Documentation
id: process_documentation

View file

@ -11,12 +11,16 @@ jobs:
setup-build:
name: Submit build to Fedora COPR
# this seems backwards, but we want to run under Fedora, but Github doesn' support that
container: fedora:latest
runs-on: ubuntu-latest
container:
image: fedora:latest
steps:
- name: Check out sources
uses: actions/checkout@v1
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Setup build dependencies in the Fedora container
run: |
@ -28,13 +32,11 @@ jobs:
git config --global --add safe.directory /__w/subsurface/subsurface
git config --global --add safe.directory /__w/subsurface/subsurface/libdivecomputer
- name: atomically create or retrieve the build number
- name: set the version information
id: version_number
if: github.event_name == 'push'
run: |
bash scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release"
version=$(cat release-version)
echo "version=$version" >> $GITHUB_OUTPUT
uses: ./.github/actions/manage-version
with:
nightly-builds-secret: ${{ secrets.NIGHTLY_BUILDS }}
- name: Setup API token for copr-cli
env:
@ -53,5 +55,5 @@ jobs:
- name: run the copr build script
run: |
cd ..
bash -x subsurface/packaging/copr/make-package.sh ${{ github.ref_name }}
bash -x subsurface/packaging/copr/make-package.sh $GITHUB_REF_NAME

View file

@ -1,4 +1,5 @@
name: iOS
on:
push:
paths-ignore:
@ -19,7 +20,10 @@ jobs:
run: sudo xcode-select -s "/Applications/Xcode_11.7.app"
- name: checkout sources
uses: actions/checkout@v1
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: setup Homebrew
run: brew install autoconf automake libtool pkg-config
@ -31,24 +35,24 @@ jobs:
ref: main
path: qt-ios
- name: store dummy version and build number for test build
- name: set the version information
id: version_number
run: |
echo "100" > latest-subsurface-buildnumber
echo "CICD-test-build" > latest-subsurface-buildnumber-extension
version=$(scripts/get-version)
echo "version=$version" >> $GITHUB_OUTPUT
uses: ./.github/actions/manage-version
with:
nightly-builds-secret: ${{ secrets.NIGHTLY_BUILDS }}
- name: build Subsurface-mobile for iOS
env:
VERSION: ${{ steps.version_number.outputs.version }}
run: |
cd ${{ github.workspace }}/..
cd ..
git config --global --add safe.directory $GITHUB_WORKSPACE
git config --global --add safe.directory $GITHUB_WORKSPACE/libdivecomputer
export IOS_QT=$GITHUB_WORKSPACE/qt-ios
echo "build for simulator"
bash -x $GITHUB_WORKSPACE/packaging/ios/build.sh -simulator
# We need this in order to be able to access the file and publish it
mv build-Subsurface-mobile-Qt_5_14_1_for_iOS-Release/Release-iphonesimulator/Subsurface-mobile.app ${{ github.workspace }}/Subsurface-mobile-${{ steps.version_number.outputs.version }}.app
mv build-Subsurface-mobile-Qt_5_14_1_for_iOS-Release/Release-iphonesimulator/Subsurface-mobile.app $GITHUB_WORKSPACE/Subsurface-mobile-$VERSION.app
- name: publish artifacts
uses: actions/upload-artifact@v4

View file

@ -0,0 +1,100 @@
name: Generic workflow for Debian and derivatives
on:
workflow_call:
inputs:
container-image:
required: true
type: string
jobs:
build:
runs-on: ubuntu-latest
container:
image: ${{ inputs.container-image }}
steps:
- name: get container ready for build
run: |
echo "--------------------------------------------------------------"
echo "update distro and install dependencies"
apt-get update
apt-get dist-upgrade -y
DEBIAN_FRONTEND=noninteractive apt-get install -y -q \
autoconf automake cmake g++ git libcrypto++-dev libcurl4-gnutls-dev \
libgit2-dev libqt5qml5 libqt5quick5 libqt5svg5-dev \
libqt5webkit5-dev libsqlite3-dev libssh2-1-dev libssl-dev libssl-dev \
libtool libusb-1.0-0-dev libxml2-dev libxslt1-dev libzip-dev make \
pkg-config qml-module-qtlocation qml-module-qtpositioning \
qml-module-qtquick2 qt5-qmake qtchooser qtconnectivity5-dev \
qtdeclarative5-dev qtdeclarative5-private-dev qtlocation5-dev \
qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools \
qtquickcontrols2-5-dev xvfb libbluetooth-dev libmtp-dev \
mdbtools-dev
git config --global user.email "ci@subsurface-divelog.org"
git config --global user.name "Subsurface CI"
git config --global --add safe.directory $GITHUB_WORKSPACE
git config --global --add safe.directory $GITHUB_WORKSPACE/libdivecomputer
# needs git from the previous step
- name: checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: set the version information
id: version_number
uses: ./.github/actions/manage-version
with:
no-increment: true
- name: build subsurface-mobile
run: |
echo "--------------------------------------------------------------"
echo "building mobile"
cd ..
bash -e -x subsurface/scripts/build.sh -mobile
- name: test mobile build
run: |
echo "--------------------------------------------------------------"
echo "running tests for mobile"
cd build-mobile/tests
# xvfb-run --auto-servernum ./TestGitStorage -v2
xvfb-run --auto-servernum make check
- name: build subsurface
run: |
echo "--------------------------------------------------------------"
echo "building desktop"
# now build for the desktop version (including WebKit)
cd ..
bash -e -x subsurface/scripts/build.sh -desktop -build-with-webkit
- name: test desktop build
run: |
echo "--------------------------------------------------------------"
echo "running tests for desktop"
cd build/tests
# xvfb-run --auto-servernum ./TestGitStorage -v2
xvfb-run --auto-servernum make check
- name: build subsurface-downloader
run: |
echo "--------------------------------------------------------------"
echo "building downloader"
cd ..
bash -e -x subsurface/scripts/build.sh -downloader
- name: build smtk2ssrf
run: |
echo "--------------------------------------------------------------"
echo "building smtk2ssrf"
# build smtk2ssrf (needs the artefacts generated by the subsurface build
cd ..
bash -e -x subsurface/scripts/smtk2ssrf-build.sh -y

View file

@ -1,4 +1,5 @@
name: Debian trixie / Qt 5.15--
on:
push:
paths-ignore:
@ -12,91 +13,7 @@ on:
- master
jobs:
build:
runs-on: ubuntu-latest
container:
image: debian:trixie
steps:
- name: checkout sources
uses: actions/checkout@v1
- name: get container ready for build
env:
SUBSURFACE_REPO_PATH: ${{ github.workspace }}
run: |
echo "--------------------------------------------------------------"
echo "update distro and install dependencies"
apt-get update
apt-get dist-upgrade -y
DEBIAN_FRONTEND=noninteractive apt-get install -y -q \
autoconf automake cmake g++ git libcrypto++-dev libcurl4-gnutls-dev \
libgit2-dev libqt5qml5 libqt5quick5 libqt5svg5-dev \
libqt5webkit5-dev libsqlite3-dev libssh2-1-dev libssl-dev libssl-dev \
libtool libusb-1.0-0-dev libxml2-dev libxslt1-dev libzip-dev make \
pkg-config qml-module-qtlocation qml-module-qtpositioning \
qml-module-qtquick2 qt5-qmake qtchooser qtconnectivity5-dev \
qtdeclarative5-dev qtdeclarative5-private-dev qtlocation5-dev \
qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools \
qtquickcontrols2-5-dev xvfb libbluetooth-dev libmtp-dev \
mdbtools-dev
git config --global user.email "ci@subsurface-divelog.org"
git config --global user.name "Subsurface CI"
git config --global --add safe.directory ${SUBSURFACE_REPO_PATH}
git config --global --add safe.directory ${SUBSURFACE_REPO_PATH}/libdivecomputer
- name: store dummy version and build number for test build
run: |
echo "100" > latest-subsurface-buildnumber
echo "CICD-test-build" > latest-subsurface-buildnumber-extension
- name: build subsurface-mobile
run: |
echo "--------------------------------------------------------------"
echo "building mobile"
cd ..
bash -e -x subsurface/scripts/build.sh -mobile
- name: test mobile build
run: |
echo "--------------------------------------------------------------"
echo "running tests for mobile"
cd build-mobile/tests
# xvfb-run --auto-servernum ./TestGitStorage -v2
xvfb-run --auto-servernum make check
- name: build subsurface
run: |
echo "--------------------------------------------------------------"
echo "building desktop"
# now build for the desktop version (including WebKit)
cd ..
bash -e -x subsurface/scripts/build.sh -desktop -build-with-webkit
- name: test desktop build
run: |
echo "--------------------------------------------------------------"
echo "running tests for desktop"
cd build/tests
# xvfb-run --auto-servernum ./TestGitStorage -v2
xvfb-run --auto-servernum make check
- name: build subsurface-downloader
run: |
echo "--------------------------------------------------------------"
echo "building downloader"
cd ..
bash -e -x subsurface/scripts/build.sh -downloader
- name: build smtk2ssrf
run: |
echo "--------------------------------------------------------------"
echo "building smtk2ssrf"
# build smtk2ssrf (needs the artefacts generated by the subsurface build
cd ..
bash -e -x subsurface/scripts/smtk2ssrf-build.sh -y
do-build-test:
uses: ./.github/workflows/linux-debian-generic.yml
with:
container-image: debian:trixie

View file

@ -1,4 +1,5 @@
name: Fedora 35 / Qt 6--
on:
push:
paths-ignore:
@ -18,9 +19,6 @@ jobs:
image: fedora:35
steps:
- name: checkout sources
uses: actions/checkout@v1
- name: get container ready for build
run: |
echo "--------------------------------------------------------------"
@ -37,22 +35,27 @@ jobs:
bluez-libs-devel libgit2-devel libzip-devel libmtp-devel \
xorg-x11-server-Xvfb
- name: store dummy version and build number for test build
run: |
echo "100" > latest-subsurface-buildnumber
echo "CICD-test-build" > latest-subsurface-buildnumber-extension
- name: checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: set the version information
id: version_number
uses: ./.github/actions/manage-version
with:
no-increment: true
- name: build Subsurface
env:
SUBSURFACE_REPO_PATH: ${{ github.workspace }}
run: |
echo "--------------------------------------------------------------"
echo "building desktop"
# now build for the desktop version (without WebKit)
cd ..
git config --global --add safe.directory ${SUBSURFACE_REPO_PATH}
git config --global --add safe.directory ${SUBSURFACE_REPO_PATH}/libdivecomputer
git config --global --add safe.directory $GITHUB_WORKSPACE
git config --global --add safe.directory $GITHUB_WORKSPACE/libdivecomputer
git config --global --get-all safe.directory
bash -e -x subsurface/scripts/build.sh -desktop -build-with-qt6

View file

@ -19,16 +19,16 @@ jobs:
timeout-minutes: 60
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# Needed for version determination to work
fetch-depth: 0
submodules: recursive
- name: atomically create or retrieve the build number
- name: set the version information
id: version_number
if: github.event_name == 'push'
run: |
bash scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release"
uses: ./.github/actions/manage-version
with:
nightly-builds-secret: ${{ secrets.NIGHTLY_BUILDS }}
- name: store dummy version and build number for pull request
if: github.event_name == 'pull_request'
@ -52,7 +52,7 @@ jobs:
# Find common base between master and HEAD to use as cache key.
git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules origin master
echo "key=$( git merge-base origin/master ${{ github.sha }} )" >> $GITHUB_OUTPUT
echo "key=$( git merge-base origin/master $GITHUB_SHA )" >> $GITHUB_OUTPUT
- name: CCache
uses: actions/cache@v3

View file

@ -1,4 +1,5 @@
name: Ubuntu 16.04 / Qt 5.15-- for AppImage
on:
push:
paths-ignore:
@ -18,9 +19,6 @@ jobs:
image: ubuntu:16.04
steps:
- name: checkout sources
uses: actions/checkout@v1
- name: get container ready for build
run: |
echo "--------------------------------------------------------------"
@ -45,8 +43,8 @@ jobs:
add-apt-repository -y ppa:savoury1/gtk-xenial
add-apt-repository -y ppa:savoury1/qt-xenial
add-apt-repository -y ppa:savoury1/kde-xenial
add-apt-repository -y ppa:mayeut-github/devtoolset-10
add-apt-repository -y 'deb https://apt.kitware.com/ubuntu/ xenial main'
add-apt-repository -y ppa:savoury1/backports
add-apt-repository -y ppa:savoury1/build-tools
apt-get update
apt-get dist-upgrade -y
DEBIAN_FRONTEND=noninteractive apt-get install -y -q \
@ -58,27 +56,23 @@ jobs:
qml-module-qtquick2 qt5-qmake qtchooser qtconnectivity5-dev \
qtdeclarative5-dev qtdeclarative5-private-dev qtlocation5-dev \
qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools \
qtquickcontrols2-5-dev xvfb libbluetooth-dev libmtp-dev
qtquickcontrols2-5-dev xvfb libbluetooth-dev libmtp-dev liblzma-dev
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 \
--slave /usr/bin/g++ g++ /usr/bin/g++-9
- name: atomically create or retrieve the build number and assemble release notes
id: version_number
if: github.event_name == 'push'
run: |
bash ./scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release"
version=$(cat release-version)
echo "version=$version" >> $GITHUB_OUTPUT
- name: checkout sources
# We cannot update this as glibc on 16.04 is too old for node 20.
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: store dummy version and build number for pull request
id: pull_request_version_number
if: github.event_name == 'pull_request'
run: |
echo "100" > latest-subsurface-buildnumber
echo "CICD-pull-request" > latest-subsurface-buildnumber-extension
version=$(scripts/get-version)
echo "version=$version" >> $GITHUB_OUTPUT
- name: set the version information
id: version_number
uses: ./.github/actions/manage-version
with:
nightly-builds-secret: ${{ secrets.NIGHTLY_BUILDS }}
- name: build Subsurface
run: |
@ -98,6 +92,8 @@ jobs:
xvfb-run --auto-servernum make check
- name: build appimage
env:
VERSION: ${{ steps.version_number.outputs.version }}
run: |
echo "--------------------------------------------------------------"
echo "assembling AppImage"
@ -131,22 +127,18 @@ jobs:
./linuxdeployqt*.AppImage --appimage-extract-and-run ./appdir/usr/share/applications/*.desktop -exclude-libs=libdbus-1.so.3 -appimage -qmldir=./subsurface/stats -qmldir=./subsurface/map-widget/ -verbose=2
# copy AppImage to the calling VM
# with GitHub Actions the /${GITHUB_WORKSPACE} directory is the current working directory at the start of a step
cp Subsurface*.AppImage* /${GITHUB_WORKSPACE}/Subsurface.AppImage
# with GitHub Actions the $GITHUB_WORKSPACE directory is the current working directory at the start of a step
cp Subsurface*.AppImage* $GITHUB_WORKSPACE/Subsurface-$VERSION.AppImage
- name: PR artifacts
if: github.event_name == 'pull_request'
# We cannot update this as glibc on 16.04 is too old for node 20.
uses: actions/upload-artifact@v3
with:
name: Subsurface-Linux-AppImage-${{ steps.pull_request_version_number.outputs.version }}
path: Subsurface.AppImage
name: Subsurface-Linux-AppImage-${{ steps.version_number.outputs.version }}
path: Subsurface-*.AppImage
compression-level: 0
- name: prepare release artifacts
if: github.event_name == 'push'
run: |
mv Subsurface.AppImage Subsurface-v${{ steps.version_number.outputs.version }}.AppImage
# only publish a 'release' on push events (those include merging a PR)
- name: upload binaries
if: github.event_name == 'push'
@ -158,4 +150,4 @@ jobs:
prerelease: false
fail_on_unmatched_files: true
files: |
./Subsurface*.AppImage
./Subsurface-*.AppImage

View file

@ -1,4 +1,5 @@
name: Ubuntu 20.04 / Qt 5.12--
on:
push:
paths-ignore:
@ -12,74 +13,7 @@ on:
- master
jobs:
build:
runs-on: ubuntu-latest
container:
image: ubuntu:20.04
steps:
- name: checkout sources
uses: actions/checkout@v1
- name: get container ready for build
run: |
echo "--------------------------------------------------------------"
echo "update distro and install dependencies"
apt-get update
apt-get dist-upgrade -y
DEBIAN_FRONTEND=noninteractive apt-get install -y -q \
autoconf automake cmake g++ git libcrypto++-dev libcurl4-gnutls-dev \
libgit2-dev libqt5qml5 libqt5quick5 libqt5svg5-dev \
libqt5webkit5-dev libsqlite3-dev libssh2-1-dev libssl-dev libssl-dev \
libtool libusb-1.0-0-dev libxml2-dev libxslt1-dev libzip-dev make \
pkg-config qml-module-qtlocation qml-module-qtpositioning \
qml-module-qtquick2 qt5-qmake qtchooser qtconnectivity5-dev \
qtdeclarative5-dev qtdeclarative5-private-dev qtlocation5-dev \
qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools \
qtquickcontrols2-5-dev xvfb libbluetooth-dev libmtp-dev
- name: store dummy version and build number for test build
run: |
echo "100" > latest-subsurface-buildnumber
echo "CICD-test-build" > latest-subsurface-buildnumber-extension
- name: build Subsurface-mobile
env:
SUBSURFACE_REPO_PATH: ${{ github.workspace }}
run: |
echo "--------------------------------------------------------------"
echo "building mobile"
git config --global user.email "ci@subsurface-divelog.org"
git config --global user.name "Subsurface CI"
git config --global --add safe.directory ${SUBSURFACE_REPO_PATH}
git config --global --add safe.directory ${SUBSURFACE_REPO_PATH}/libdivecomputer
cd ..
bash -e -x subsurface/scripts/build.sh -mobile
- name: test mobile build
run: |
echo "--------------------------------------------------------------"
echo "running tests for mobile"
cd build-mobile/tests
# xvfb-run --auto-servernum ./TestGitStorage -v2
xvfb-run --auto-servernum make check
- name: build Subsurface
run: |
echo "--------------------------------------------------------------"
echo "building desktop"
# now build for the desktop version (including WebKit)
cd ..
bash -e -x subsurface/scripts/build.sh -desktop -build-with-webkit
- name: test desktop build
run: |
echo "--------------------------------------------------------------"
echo "running tests for desktop"
cd build/tests
# xvfb-run --auto-servernum ./TestGitStorage -v2
xvfb-run --auto-servernum make check
do-build-test:
uses: ./.github/workflows/linux-debian-generic.yml
with:
container-image: ubuntu:20.04

View file

@ -1,4 +1,5 @@
name: Ubuntu 22.04 / Qt 5.15--
on:
push:
paths-ignore:
@ -12,91 +13,7 @@ on:
- master
jobs:
build:
runs-on: ubuntu-latest
container:
image: ubuntu:22.04
steps:
- name: checkout sources
uses: actions/checkout@v1
- name: get container ready for build
env:
SUBSURFACE_REPO_PATH: ${{ github.workspace }}
run: |
echo "--------------------------------------------------------------"
echo "update distro and install dependencies"
apt-get update
apt-get dist-upgrade -y
DEBIAN_FRONTEND=noninteractive apt-get install -y -q \
autoconf automake cmake g++ git libcrypto++-dev libcurl4-gnutls-dev \
libgit2-dev libqt5qml5 libqt5quick5 libqt5svg5-dev \
libqt5webkit5-dev libsqlite3-dev libssh2-1-dev libssl-dev libssl-dev \
libtool libusb-1.0-0-dev libxml2-dev libxslt1-dev libzip-dev make \
pkg-config qml-module-qtlocation qml-module-qtpositioning \
qml-module-qtquick2 qt5-qmake qtchooser qtconnectivity5-dev \
qtdeclarative5-dev qtdeclarative5-private-dev qtlocation5-dev \
qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools \
qtquickcontrols2-5-dev xvfb libbluetooth-dev libmtp-dev \
mdbtools-dev
git config --global user.email "ci@subsurface-divelog.org"
git config --global user.name "Subsurface CI"
git config --global --add safe.directory ${SUBSURFACE_REPO_PATH}
git config --global --add safe.directory ${SUBSURFACE_REPO_PATH}/libdivecomputer
- name: store dummy version and build number for test build
run: |
echo "100" > latest-subsurface-buildnumber
echo "CICD-test-build" > latest-subsurface-buildnumber-extension
- name: build subsurface-mobile
run: |
echo "--------------------------------------------------------------"
echo "building mobile"
cd ..
bash -e -x subsurface/scripts/build.sh -mobile
- name: test mobile build
run: |
echo "--------------------------------------------------------------"
echo "running tests for mobile"
cd build-mobile/tests
# xvfb-run --auto-servernum ./TestGitStorage -v2
xvfb-run --auto-servernum make check
- name: build subsurface
run: |
echo "--------------------------------------------------------------"
echo "building desktop"
# now build for the desktop version (including WebKit)
cd ..
bash -e -x subsurface/scripts/build.sh -desktop -build-with-webkit
- name: test desktop build
run: |
echo "--------------------------------------------------------------"
echo "running tests for desktop"
cd build/tests
# xvfb-run --auto-servernum ./TestGitStorage -v2
xvfb-run --auto-servernum make check
- name: build subsurface-downloader
run: |
echo "--------------------------------------------------------------"
echo "building downloader"
cd ..
bash -e -x subsurface/scripts/build.sh -downloader
- name: build smtk2ssrf
run: |
echo "--------------------------------------------------------------"
echo "building smtk2ssrf"
# build smtk2ssrf (needs the artefacts generated by the subsurface build
cd ..
bash -e -x subsurface/scripts/smtk2ssrf-build.sh -y
do-build-test:
uses: ./.github/workflows/linux-debian-generic.yml
with:
container-image: ubuntu:22.04

View file

@ -1,4 +1,5 @@
name: Ubuntu 24.04 / Qt 5.15--
on:
push:
paths-ignore:
@ -12,91 +13,7 @@ on:
- master
jobs:
build:
runs-on: ubuntu-latest
container:
image: ubuntu:24.04
steps:
- name: checkout sources
uses: actions/checkout@v1
- name: get container ready for build
env:
SUBSURFACE_REPO_PATH: ${{ github.workspace }}
run: |
echo "--------------------------------------------------------------"
echo "update distro and install dependencies"
apt-get update
apt-get dist-upgrade -y
DEBIAN_FRONTEND=noninteractive apt-get install -y -q \
autoconf automake cmake g++ git libcrypto++-dev libcurl4-gnutls-dev \
libgit2-dev libqt5qml5 libqt5quick5 libqt5svg5-dev \
libqt5webkit5-dev libsqlite3-dev libssh2-1-dev libssl-dev libssl-dev \
libtool libusb-1.0-0-dev libxml2-dev libxslt1-dev libzip-dev make \
pkg-config qml-module-qtlocation qml-module-qtpositioning \
qml-module-qtquick2 qt5-qmake qtchooser qtconnectivity5-dev \
qtdeclarative5-dev qtdeclarative5-private-dev qtlocation5-dev \
qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools \
qtquickcontrols2-5-dev xvfb libbluetooth-dev libmtp-dev \
mdbtools-dev
git config --global user.email "ci@subsurface-divelog.org"
git config --global user.name "Subsurface CI"
git config --global --add safe.directory ${SUBSURFACE_REPO_PATH}
git config --global --add safe.directory ${SUBSURFACE_REPO_PATH}/libdivecomputer
- name: store dummy version and build number for test build
run: |
echo "100" > latest-subsurface-buildnumber
echo "CICD-test-build" > latest-subsurface-buildnumber-extension
- name: build subsurface-mobile
run: |
echo "--------------------------------------------------------------"
echo "building mobile"
cd ..
bash -e -x subsurface/scripts/build.sh -mobile
- name: test mobile build
run: |
echo "--------------------------------------------------------------"
echo "running tests for mobile"
cd build-mobile/tests
# xvfb-run --auto-servernum ./TestGitStorage -v2
xvfb-run --auto-servernum make check
- name: build subsurface
run: |
echo "--------------------------------------------------------------"
echo "building desktop"
# now build for the desktop version (including WebKit)
cd ..
bash -e -x subsurface/scripts/build.sh -desktop -build-with-webkit
- name: test desktop build
run: |
echo "--------------------------------------------------------------"
echo "running tests for desktop"
cd build/tests
# xvfb-run --auto-servernum ./TestGitStorage -v2
xvfb-run --auto-servernum make check
- name: build subsurface-downloader
run: |
echo "--------------------------------------------------------------"
echo "building downloader"
cd ..
bash -e -x subsurface/scripts/build.sh -downloader
- name: build smtk2ssrf
run: |
echo "--------------------------------------------------------------"
echo "building smtk2ssrf"
# build smtk2ssrf (needs the artefacts generated by the subsurface build
cd ..
bash -e -x subsurface/scripts/smtk2ssrf-build.sh -y
do-build-test:
uses: ./.github/workflows/linux-debian-generic.yml
with:
container-image: ubuntu:24.04

View file

@ -18,23 +18,9 @@ jobs:
steps:
- name: checkout sources
uses: actions/checkout@v4
- name: atomically create or retrieve the build number and assemble release notes
id: version_number
if: github.event_name == 'push'
run: |
bash scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release"
version=$(cat release-version)
echo "version=$version" >> $GITHUB_OUTPUT
- name: store dummy version and build number for pull request
id: pull_request_version_number
if: github.event_name == 'pull_request'
run: |
echo "100" > latest-subsurface-buildnumber
echo "CICD-pull-request" > latest-subsurface-buildnumber-extension
version=$(scripts/get-version)
echo "version=$version" >> $GITHUB_OUTPUT
with:
fetch-depth: 0
submodules: recursive
- name: setup Homebrew
run: brew install hidapi libxslt libjpg libmtp create-dmg confuse
@ -46,6 +32,12 @@ jobs:
ref: main
path: qt-mac
- name: set the version information
id: version_number
uses: ./.github/actions/manage-version
with:
nightly-builds-secret: ${{ secrets.NIGHTLY_BUILDS }}
- name: build Subsurface
id: build
run: |
@ -70,7 +62,7 @@ jobs:
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: Subsurface-MacOS-${{ steps.pull_request_version_number.outputs.version }}
name: Subsurface-MacOS-${{ steps.version_number.outputs.version }}
path: ${{ steps.build.outputs.dmg }}
compression-level: 0

View file

@ -1,4 +1,5 @@
name: Post Release
name: Post Release Notes
on:
push:
paths-ignore:
@ -6,24 +7,28 @@ on:
branches:
- master
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
postRelease:
runs-on: ubuntu-latest
steps:
- name: checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: set the version information
id: version_number
uses: ./.github/actions/manage-version
with:
nightly-builds-secret: ${{ secrets.NIGHTLY_BUILDS }}
# since we are running this step on a pull request, we will skip build numbers in releases
- name: atomically create or retrieve the build number and assemble release notes
id: version_number
- name: assemble release notes
env:
EVENT_HEAD_COMMIT_ID: ${{ github.event.head_commit.id }}
run: |
bash -x ./scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release"
bash scripts/create-releasenotes.sh ${{ github.event.head_commit.id }}
version=$(cat release-version)
echo "version=$version" >> $GITHUB_OUTPUT
bash scripts/create-releasenotes.sh $EVENT_HEAD_COMMIT_ID
# add a file containing the release title so it can be picked up and listed on the release page on our web server
- name: publish release

View file

@ -15,13 +15,16 @@ jobs:
steps:
- name: Check out sources
uses: actions/checkout@v1
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: atomically create or retrieve the build number
- name: set the version information
id: version_number
if: github.event_name == 'push'
run: |
bash scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release"
uses: ./.github/actions/manage-version
with:
nightly-builds-secret: ${{ secrets.NIGHTLY_BUILDS }}
- name: Setup build dependencies
run: |
@ -48,5 +51,5 @@ jobs:
- name: run the launchpad make-package script
run: |
cd ..
bash -x subsurface/packaging/ubuntu/make-package.sh ${{ github.ref_name }}
bash -x subsurface/packaging/ubuntu/make-package.sh $GITHUB_REF_NAME

View file

@ -16,17 +16,17 @@ jobs:
mxe_sha: 'c0bfefc57a00fdf6cb5278263e21a478e47b0bf5'
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Build the name for the docker image
id: build_name
run: |
v=${{ env.VERSION }}
b=${{ github.ref }} # -BRANCH suffix, unless the branch is master
v=$VERSION
b=$GITHUB_REF # -BRANCH suffix, unless the branch is master
b=${b/refs\/heads\//}
b=${b,,} # the name needs to be all lower case
if [ $b = "master" ] ; then b="" ; else b="-$b" ; fi
echo "NAME=${{ github.repository_owner }}/mxe-build${b}:${v}" >> $GITHUB_OUTPUT
echo "NAME=$GITHUB_REPOSITORY_OWNER/mxe-build${b}:${v}" >> $GITHUB_OUTPUT
- name: Build and Publish Linux Docker image to Dockerhub
uses: elgohr/Publish-Docker-Github-Action@v5

View file

@ -1,4 +1,5 @@
name: Windows
on:
push:
paths-ignore:
@ -12,28 +13,23 @@ on:
- master
jobs:
buildWindows:
build:
runs-on: ubuntu-latest
container:
image: docker://subsurface/mxe-build:3.1.0
steps:
- name: checkout sources
uses: actions/checkout@v1
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: atomically create or retrieve the build number and assemble release notes
- name: set the version information
id: version_number
if: github.event_name == 'push'
run: |
bash scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release"
version=$(cat release-version)
echo "version=$version" >> $GITHUB_OUTPUT
- name: store dummy version and build number for pull request
if: github.event_name == 'pull_request'
run: |
echo "100" > latest-subsurface-buildnumber
echo "CICD-pull-request" > latest-subsurface-buildnumber-extension
uses: ./.github/actions/manage-version
with:
nightly-builds-secret: ${{ secrets.NIGHTLY_BUILDS }}
- name: get other dependencies
env:
@ -53,6 +49,15 @@ jobs:
bash -x subsurface/packaging/windows/in-container-build.sh 2>&1 | tee build.log
grep "Built target installer" build.log
- name: publish pull request artifacts
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: Subsurface-Windows-${{ steps.version_number.outputs.version }}
path: |
subsurface*.exe*
smtk2ssrf*.exe
# only publish a 'release' on push events (those include merging a PR)
- name: upload binaries
if: github.event_name == 'push'