replace github release actions with the gh tool in bash (#4746)

* replace github release actions with the gh tool in bash

* set macos 10.15 qt version to 6.2 LTS
This commit is contained in:
ebbit1q 2023-02-10 09:33:48 +01:00 committed by GitHub
parent ef38a8bb2b
commit 787c8d740b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 52 additions and 39 deletions

View file

@ -127,7 +127,7 @@ fi
# Add cmake --build flags # Add cmake --build flags
buildflags=(--config "$BUILDTYPE") buildflags=(--config "$BUILDTYPE")
if [[ $PARALLEL_COUNT ]]; then if [[ $PARALLEL_COUNT ]]; then
if [[ $(cmake --build /not_a_dir --parallel |& head -1) =~ parallel ]]; then if [[ $(cmake --build /not_a_dir --parallel 2>&1 | head -1) =~ parallel ]]; then
# workaround for bionic having an old cmake # workaround for bionic having an old cmake
echo "this version of cmake does not support --parallel, using native build tool -j instead" echo "this version of cmake does not support --parallel, using native build tool -j instead"
buildflags+=(-- -j "$PARALLEL_COUNT") buildflags+=(-- -j "$PARALLEL_COUNT")
@ -171,7 +171,7 @@ fi
if [[ $MAKE_TEST ]]; then if [[ $MAKE_TEST ]]; then
echo "::group::Run tests" echo "::group::Run tests"
ctest -C "$BUILDTYPE" ctest -C "$BUILDTYPE" --output-on-failure
echo "::endgroup::" echo "::endgroup::"
fi fi

View file

@ -23,7 +23,6 @@ jobs:
outputs: outputs:
tag: ${{steps.configure.outputs.tag}} tag: ${{steps.configure.outputs.tag}}
sha: ${{steps.configure.outputs.sha}} sha: ${{steps.configure.outputs.sha}}
upload_url: ${{steps.create_release.outputs.upload_url}}
steps: steps:
- name: Cancel previous runs - name: Cancel previous runs
@ -64,15 +63,19 @@ jobs:
- name: Create release - name: Create release
if: steps.configure.outputs.tag != null if: steps.configure.outputs.tag != null
id: create_release id: create_release
uses: actions/create-release@v1 shell: bash
env: env:
GITHUB_TOKEN: ${{github.token}} GH_TOKEN: ${{github.token}}
with: tag_name: ${{steps.configure.outputs.tag}}
tag_name: ${{github.ref}}
release_name: ${{steps.prepare.outputs.title}} release_name: ${{steps.prepare.outputs.title}}
body_path: ${{steps.prepare.outputs.body_path}} body_path: ${{steps.prepare.outputs.body_path}}
draft: true prerelease: ${{steps.prepare.outputs.is_beta}}
prerelease: ${{steps.prepare.outputs.is_beta == 'yes'}} run: |
if [[ $prerelease == yes ]]; then
args="--prerelease"
fi
gh release create "$tag_name" --draft --verify-tag $args \
--title "$release_name" --notes-file "$body_path"
build-linux: build-linux:
strategy: strategy:
@ -156,7 +159,7 @@ jobs:
RUN --server --debug --test --ccache "$CCACHE_SIZE" --parallel 2 RUN --server --debug --test --ccache "$CCACHE_SIZE" --parallel 2
- name: Build release package - name: Build release package
id: package id: build
if: matrix.package != 'skip' if: matrix.package != 'skip'
shell: bash shell: bash
env: env:
@ -175,19 +178,18 @@ jobs:
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: ${{matrix.distro}}-package name: ${{matrix.distro}}-package
path: ${{steps.package.outputs.path}} path: ${{steps.build.outputs.path}}
if-no-files-found: error if-no-files-found: error
- name: Upload to release - name: Upload to release
if: matrix.package != 'skip' && needs.configure.outputs.tag != null if: matrix.package != 'skip' && needs.configure.outputs.tag != null
uses: actions/upload-release-asset@v1 shell: bash
env: env:
GITHUB_TOKEN: ${{github.token}} GH_TOKEN: ${{github.token}}
with: tag_name: ${{needs.configure.outputs.tag}}
upload_url: ${{needs.configure.outputs.upload_url}} asset_path: ${{steps.build.outputs.path}}
asset_path: ${{steps.package.outputs.path}} asset_name: ${{steps.build.outputs.name}}
asset_name: ${{steps.package.outputs.name}} run: gh release upload "$tag_name" "$asset_path#$asset_name"
asset_content_type: application/octet-stream
build-macos: build-macos:
strategy: strategy:
@ -196,15 +198,17 @@ jobs:
include: include:
- target: Debug # tests only - target: Debug # tests only
os: macos-latest os: macos-latest
xcode: 12.5.1 xcode: 14.2
qt_version: 6 qt_version: 6.*
qt_modules: "qtmultimedia qtwebsockets"
type: Debug type: Debug
do_tests: 1 do_tests: 1
- target: 10.15_Catalina - target: 10.15_Catalina
os: macos-11 os: macos-11
xcode: 11.7 # allows using macOS 10.15 SDK xcode: 11.7 # allows using macOS 10.15 SDK
qt_version: 6 qt_version: 6.2.* # LTS (is compatible with 10.14 and 10.15)
qt_modules: "qtmultimedia qtwebsockets"
type: Release type: Release
do_tests: 1 do_tests: 1
make_package: 1 make_package: 1
@ -212,7 +216,7 @@ jobs:
- target: 11_Big_Sur - target: 11_Big_Sur
os: macos-11 os: macos-11
xcode: 12.5.1 xcode: 12.5.1
qt_version: 6 qt_version: homebrew
type: Release type: Release
do_tests: 1 do_tests: 1
make_package: 1 make_package: 1
@ -220,7 +224,7 @@ jobs:
# - target: 12_Monterey # - target: 12_Monterey
# os: macos-12 # os: macos-12
# xcode: 13.3 # xcode: 13.3
# qt_version: 6 # qt_version: homebrew
# type: Release # type: Release
# do_tests: 1 # do_tests: 1
# make_package: 1 # make_package: 1
@ -242,11 +246,24 @@ jobs:
# cmake cannot find the mysql connector # cmake cannot find the mysql connector
# neither of these works: mariadb-connector-c mysql-connector-c++ # neither of these works: mariadb-connector-c mysql-connector-c++
env: env:
qt_version: 'qt@${{matrix.qt_version}}' install_qt: ${{matrix.qt_version}}
run: | run: |
brew update brew update
brew install protobuf brew install protobuf
brew install "$qt_version" --force-bottle if [[ $install_qt == homebrew ]]; then
brew install qt --force-bottle
else # for some reason the tests fail with the action installed qt?
brew install googletest
fi
- name: Install Qt ${{matrix.qt_version}} for ${{matrix.target}}
if: matrix.qt_version != 'homebrew'
uses: jurplel/install-qt-action@v3
with:
cache: true
setup-python: false
version: ${{matrix.qt_version}}
modules: ${{matrix.qt_modules}}
- name: Build on Xcode ${{matrix.xcode}} - name: Build on Xcode ${{matrix.xcode}}
shell: bash shell: bash
@ -256,8 +273,6 @@ jobs:
MAKE_TEST: '${{matrix.do_tests}}' MAKE_TEST: '${{matrix.do_tests}}'
MAKE_PACKAGE: '${{matrix.make_package}}' MAKE_PACKAGE: '${{matrix.make_package}}'
PACKAGE_SUFFIX: '-macOS-${{matrix.target}}' PACKAGE_SUFFIX: '-macOS-${{matrix.target}}'
# set QTDIR to find qt5, qt6 can be found without this
QTDIR: '/usr/local/opt/qt5'
# Mac machines actually have 3 cores # Mac machines actually have 3 cores
run: .ci/compile.sh --server --parallel 3 run: .ci/compile.sh --server --parallel 3
@ -270,15 +285,14 @@ jobs:
if-no-files-found: error if-no-files-found: error
- name: Upload to release - name: Upload to release
if: matrix.make_package && needs.configure.outputs.tag != null if: matrix.package != 'skip' && needs.configure.outputs.tag != null
uses: actions/upload-release-asset@v1 shell: bash
env: env:
GITHUB_TOKEN: ${{github.token}} GH_TOKEN: ${{github.token}}
with: tag_name: ${{needs.configure.outputs.tag}}
upload_url: ${{needs.configure.outputs.upload_url}}
asset_path: ${{steps.build.outputs.path}} asset_path: ${{steps.build.outputs.path}}
asset_name: ${{steps.build.outputs.name}} asset_name: ${{steps.build.outputs.name}}
asset_content_type: application/octet-stream run: gh release upload "$tag_name" "$asset_path#$asset_name"
build-windows: build-windows:
strategy: strategy:
@ -363,12 +377,11 @@ jobs:
if-no-files-found: error if-no-files-found: error
- name: Upload to release - name: Upload to release
if: needs.configure.outputs.tag != null if: matrix.package != 'skip' && needs.configure.outputs.tag != null
uses: actions/upload-release-asset@v1 shell: bash
env: env:
GITHUB_TOKEN: ${{github.token}} GH_TOKEN: ${{github.token}}
with: tag_name: ${{needs.configure.outputs.tag}}
upload_url: ${{needs.configure.outputs.upload_url}}
asset_path: ${{steps.build.outputs.path}} asset_path: ${{steps.build.outputs.path}}
asset_name: ${{steps.build.outputs.name}} asset_name: ${{steps.build.outputs.name}}
asset_content_type: application/octet-stream run: gh release upload "$tag_name" "$asset_path#$asset_name"