forked from subsurface/subsurface
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]>
- Loading branch information
Showing
32 changed files
with
399 additions
and
536 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Manage the Subsurface CICD versioning | ||
|
||
inputs: | ||
no-increment: | ||
description: Only get the current version, do not increment it even for pushevents | ||
default: false | ||
nightly-builds-secret: | ||
description: The secret to access the nightly builds repository | ||
default: '' | ||
|
||
outputs: | ||
version: | ||
description: The long form version number | ||
value: ${{ steps.version_number.outputs.version }} | ||
buildnr: | ||
description: The build number | ||
value: ${{ steps.version_number.outputs.buildnr }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: atomically create or retrieve the build number and assemble release notes for a push (i.e. merging of a pull request) | ||
if: github.event_name == 'push' && ! inputs.no-increment | ||
env: | ||
NIGHTLY_BUILDS_SECRET: ${{ inputs.nightly-builds-secret }} | ||
shell: bash | ||
run: | | ||
if [ -z "$NIGHTLY_BUILDS_SECRET" ]; then | ||
echo "Need to supply the secret for the nightly-builds repository to increment the version number, aborting." | ||
exit 1 | ||
fi | ||
scripts/get-atomic-buildnr.sh $GITHUB_SHA $NIGHTLY_BUILDS_SECRET "CICD-release" | ||
- name: retrieve the current version number in all other cases | ||
if: github.event_name != 'push' || inputs.no-increment | ||
env: | ||
PULL_REQUEST_BRANCH: ${{ github.event.pull_request.head.ref }} | ||
shell: bash | ||
run: | | ||
echo "-pull-request-$PULL_REQUEST_BRANCH" > latest-subsurface-buildnumber-extension | ||
- name: store version number for the build | ||
id: version_number | ||
env: | ||
PULL_REQUEST_HEAD_SHA: ${{ github.event.pull_request.head.sha }} | ||
shell: bash | ||
run: | | ||
git config --global --add safe.directory $GITHUB_WORKSPACE | ||
# For a pull request we need the information from the pull request branch | ||
# and not from the merge branch on the pull request | ||
git checkout $PULL_REQUEST_HEAD_SHA | ||
version=$(scripts/get-version.sh) | ||
echo "version=$version" >> $GITHUB_OUTPUT | ||
buildnr=$(scripts/get-version.sh 1) | ||
echo "buildnr=$buildnr" >> $GITHUB_OUTPUT | ||
git checkout $GITHUB_SHA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: [email protected] | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.