Skip to content

CI_Linux

CI_Linux #59

Workflow file for this run

name: CI_Linux
on:
pull_request:
paths: ["au4/**"]
branches:
- master
schedule:
- cron: '0 3 */1 */1 *' # At 03:00 on every day-of-month for master
# - cron: '0 5 */1 */1 *' # At 05:00 on every day-of-month for current release branch
workflow_dispatch:
inputs:
build_mode:
description: 'Build mode: devel_build, nightly_build, testing_build, stable_build'
required: true
default: 'devel_build'
sentry_project:
description: 'Upload symbols and dumps to Sentry (choose a project): audacity-4(default for stable build), audacity-4-sandbox'
required: false
default: ''
env:
CI_DIR: au4/buildscripts/ci
jobs:
build_au4:
runs-on: ubuntu-22.04
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: "Configure workflow"
env:
pull_request_title: ${{ github.event.pull_request.title }}
SENTRY_SERVER_AU4_KEY: ${{ secrets.SENTRY_SERVER_AU4_KEY }}
SENTRY_SERVER_SANDBOX_KEY: ${{ secrets.SENTRY_SERVER_SANDBOX_KEY }}
SENTRY_PROJECT: ${{ github.event.inputs.sentry_project }}
run: |
ADD_INFO="_${GITHUB_REF#refs/heads/}"
if [ "${{ github.event_name }}" == "schedule" ] && [ "${{ github.event.schedule }}" == "0 5 */1 */1 *" ]; then ADD_INFO="_${{ env.CURRENT_RELEASE_BRANCH }}"; fi
if [ "${{ github.event_name }}" == "pull_request" ]; then ADD_INFO="_${{ github.event.pull_request.number }}_${pull_request_title}"; fi
BUILD_MODE=${{ github.event.inputs.build_mode }}
cmake -DEVENT=${{ github.event_name }} \
-DBUILD_MODE=${BUILD_MODE} \
-DARTIFACT_INFO="Lin_${ADD_INFO}" \
-P ${CI_DIR}/common/ci_configure.cmake
DO_BUILD='true'
UPLOAD_ARTIFACT_NAME=$(cat ./build.artifacts/env/artifact_name.env)
DO_UPLOAD_SYMBOLS='false'
SENTRY_URL=""
if [ "$SENTRY_SERVER_AU4_KEY" != "" ]; then
if [ -z "$SENTRY_PROJECT" ] && [ "$BUILD_MODE" == "stable_build" ]; then
SENTRY_PROJECT="audacity-4"
fi
if [ "$SENTRY_PROJECT" == "audacity-4" ]; then
DO_UPLOAD_SYMBOLS='true'
SENTRY_URL=https://sentry.audacityteam.org/api/5/minidump/?sentry_key=$SENTRY_SERVER_AU4_KEY
fi
fi
if [ -z "$SENTRY_PROJECT" ] && [ "$BUILD_MODE" == "nightly_build" ]; then
SENTRY_PROJECT="audacity-4-sandbox"
fi
if [ "$SENTRY_PROJECT" == "audacity-4-sandbox" ] && [ "$SENTRY_SERVER_SANDBOX_KEY" != "" ]; then
DO_UPLOAD_SYMBOLS='true'
SENTRY_URL=https://sentry.audacityteam.org/api/5/minidump/?sentry_key=$SENTRY_SERVER_SANDBOX_KEY
fi
echo "DO_BUILD=$DO_BUILD" >> $GITHUB_ENV
echo "DO_BUILD: $DO_BUILD"
echo "UPLOAD_ARTIFACT_NAME=$UPLOAD_ARTIFACT_NAME" >> $GITHUB_ENV
echo "UPLOAD_ARTIFACT_NAME: $UPLOAD_ARTIFACT_NAME"
echo "DO_UPLOAD_SYMBOLS=$DO_UPLOAD_SYMBOLS" >> $GITHUB_ENV
echo "DO_UPLOAD_SYMBOLS: $DO_UPLOAD_SYMBOLS"
echo "SENTRY_PROJECT=$SENTRY_PROJECT" >> $GITHUB_ENV
echo "SENTRY_PROJECT: $SENTRY_PROJECT"
echo "SENTRY_URL=$SENTRY_URL" >> $GITHUB_ENV
echo "SENTRY_URL: $SENTRY_URL"
- name: Install Conan
id: conan
uses: turtlebrowser/get-conan@main
- name: Setup environment
if: env.DO_BUILD == 'true'
run: |
bash ${CI_DIR}/linux/setup.sh
- name: Build
if: env.DO_BUILD == 'true'
run: |
source $HOME/build_tools/environment.sh
cmake -P ${CI_DIR}/linux/ci_build.cmake
- name: Package
if: env.DO_BUILD == 'true'
run: |
cmake -P ${CI_DIR}/linux/package.cmake
- name: Generate and upload dump symbols
if: env.DO_UPLOAD_SYMBOLS == 'true'
shell: bash
run: |
APP_BIN=$(find "$(pwd)/build.release/src/app/" -type f -name "audacity4portable*" -print -quit)
ARCH=x86-64
sudo cmake -DAPP_BIN=${APP_BIN} \
-DARCH=${ARCH} \
-DSENTRY_URL=https://sentry.audacityteam.org \
-DSENTRY_ORG=sentry \
-DSENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }} \
-DSENTRY_PROJECT=${SENTRY_PROJECT} \
-P ${CI_DIR}/crashdumps/ci_generate_and_upload.cmake
- name: Upload artifacts on GitHub
if: env.DO_BUILD == 'true'
uses: actions/upload-artifact@v4
with:
name: ${{ env.UPLOAD_ARTIFACT_NAME }}
path: ./build.artifacts/