Skip to content

Fix callback for thinkGear connection #564

Fix callback for thinkGear connection

Fix callback for thinkGear connection #564

Workflow file for this run

# Workflow tuningTrainer
name: QBrainwaveOSC
on:
pull_request:
branches: [ ]
push:
branches: [ ]
create:
tags: ['v*'] # Push events to matching v*, i.e. v1.0, v20.15.10
workflow_dispatch:
publish-www:
description: 'Publish on WWW'
required: false
type: boolean
publish-github:
description: 'Publish on GitHub'
required: false
type: boolean
env:
PKGNAME: QBrainwaveOSC
CMAKE_POLICY_VERSION_MINIMUM: 3.5
CMAKE_BUILD_TYPE: Release
jobs:
build:
strategy:
matrix:
qt-version: [ 5, 6 ]
name: [ "windows-msvc", "windows-mingw", "macos-arm64", "macos-x86_64", "linux", "linux-arm" ]
include:
- name: "windows-msvc"
os: "windows-latest"
msystem: "MSYS"
- name: "windows-mingw"
os: "windows-latest"
msystem: "UCRT64"
- name: "macos-arm64"
os: "macos-15"
- name: "macos-x86_64"
os: "macos-15-intel"
- name: "linux"
os: "ubuntu-latest"
- name: "linux-arm"
os: "ubuntu-24.04-arm"
runs-on: ${{matrix.os}}
defaults:
run:
shell: bash
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: recursive
- if: ${{ runner.os == 'Windows' }}
run: |
echo "C:\\msys64\\usr\\bin" >> $GITHUB_PATH
echo "MSYSTEM=${{ matrix.msystem }}" >> $GITHUB_ENV
- name: Setup environment
env:
PROFILE_NAME: ${{ matrix.name }}
QT_VERSION_MAJOR: ${{ matrix.qt-version }}
OWNCLOUD_TOKEN: ${{ secrets.OWNCLOUD_TOKEN }}
run: |
export SCRIPTS_DIR=$(cd buildscripts; pwd)
TMP=$(cd $RUNNER_TEMP; pwd)
export TMPDIR=$(mktemp -p $TMP -d .job-build-XXXXXXXX)
export BASH_ENV=$TMPDIR/.bashenv
cat > $BASH_ENV << EOF
export PKGNAME=$PKGNAME
export PKGVERSION=$(< project-version)
export QT_VERSION_MAJOR=${{ matrix.qt-version }}
export ARTIFACTS_DIR=$(pwd)/out/
export TMPDIR=$TMPDIR
export SCRIPTS_DIR=$SCRIPTS_DIR
export ENV_FILE=$TMPDIR/environment.sh
EOF
echo BASH_ENV=$BASH_ENV >> $GITHUB_ENV
./buildscripts/setup_environment.sh
- name: Install dependencies
run: ./buildscripts/install_dependencies.sh
- name: Configure & compile
run: ./buildscripts/compile.sh
- name: Create package
run: ./buildscripts/package.sh
- run: |
source $ENV_FILE || true
echo FULL_PKGNAME=$FULL_PKGNAME >> $GITHUB_ENV
- uses: actions/upload-artifact@v4
with:
name: ${{env.FULL_PKGNAME}}
path: ${{github.workspace}}/out/*
publish:
needs: build
#if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Get Build Tag
id: get_tag
run: |
DATE=$(date +'%Y%m%d-%H%M')
PKGVERSION=$(< $GITHUB_WORKSPACE/project-version)
if [[ $GITHUB_REF_TYPE == "branch" ]]; then
PKGREVISION=$(git rev-parse --short HEAD)
fi
BUILD_TAG=${PKGVERSION}${PKGREVISION+.}${PKGREVISION}
FULL_PKGNAME=${PKGNAME}-${PKGVERSION}${PKGREVISION+.}${PKGREVISION}
echo PKGVERSION=$PKGVERSION >> $GITHUB_ENV
echo FULL_PKGNAME=$FULL_PKGNAME >> $GITHUB_ENV
echo "BUILD_TAG=${BUILD_TAG}" >> $GITHUB_ENV
echo DATE=$DATE >> $GITHUB_ENV
- name: Setup environment
run: |
sudo apt-get update
sudo apt-get install -y libarchive-tools
echo ARTIFACTS_DIR=$RUNNER_WORKSPACE/artifacts >> $GITHUB_ENV
set -a; source $GITHUB_ENV; set +a
[[ ! -e $ARTIFACTS_DIR ]] && mkdir $ARTIFACTS_DIR
- name: Get artifacts
uses: actions/download-artifact@v4
with:
path: ${{runner.workspace}}/artifacts-temp
- name: Flat structure
run: |
find $RUNNER_WORKSPACE/artifacts-temp -type f \
-exec mv -v {} $ARTIFACTS_DIR \;
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') # this is a snapshot build. create a release and upload binaries
name: Create Snapshot Release
uses: softprops/action-gh-release@v2
with:
name: ${{ env.BUILD_TAG }}
tag_name: ${{ env.BUILD_TAG }}
generate_release_notes: true
prerelease: true
files: |
${{runner.workspace}}/artifacts/*
- if: github.event_name == 'create' && startsWith(github.ref, 'refs/tags/v') # this is a versioned build. check if release already exists
name: Find Existing Release
id: find_release
uses: cardinalby/git-get-release-action@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
doNotFailIfNotFound: true
tag: ${{ github.ref_name }}
- if: github.event_name == 'create' && startsWith(github.ref, 'refs/tags/v') && steps.find_release.outputs.id != 0 # otherwise release does not exist, create one and upload binaries
name: Create Tagged Release
uses: softprops/action-gh-release@v1
with:
name: ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
generate_release_notes: true
prerelease: false
files: |
${{runner.workspace}}/artifacts/*
- name: Publish on freeshell
env:
OWNCLOUD_TOKEN: ${{ secrets.OWNCLOUD_TOKEN }}
FREESHELL_HTTP: ${{ runner.temp }}/.freeshell-http.conf
run: |
if [[ -n $OWNCLOUD_TOKEN ]]; then
curl -H "Authorization: Basic $OWNCLOUD_TOKEN" -L https://freeshell.de/owncloud/remote.php/webdav/CI/secrets/freeshell-http.conf > $FREESHELL_HTTP
md5sum $FREESHELL_HTTP
. $FREESHELL_HTTP
cd ${GITHUB_WORKSPACE}
if [[ $GITHUB_REF_TYPE == "tag" ]]; then
_subdir=$GITHUB_REF_NAME
else
_subdir=$GITHUB_REF_NAME/$DATE
fi
cd ${ARTIFACTS_DIR}
_root_url=${FREESHELL_ROOT_URL}/pub/QBrainwaveOSC/$_subdir/
for f in *; do
[[ -f $f ]] && curl -XPUT -H "$FREESHELL_HEADER" -qL "${_root_url}/$f" -T $f
done
cd $(dirname ${GITHUB_WORKSPACE})
tar -vcz $(basename $GITHUB_WORKSPACE) | curl -XPUT -H "$FREESHELL_HEADER" -T - -qL "${_root_url}/${FULL_PKGNAME}-source.tar.gz"
bsdtar --format zip -vc $(basename $GITHUB_WORKSPACE) | curl -XPUT -H "$FREESHELL_HEADER" -T - -qL "${_root_url}/${FULL_PKGNAME}-source.zip"
fi