Generate and upload cpack artifacts #27
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
name: Build KRunner Plugins | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- github_actions | ||
pull_request: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
inputs: | ||
publish-version: | ||
description: "new version that should get published" | ||
required: false | ||
jobs: | ||
build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- name: ubuntu | ||
image: invent-registry.kde.org/neon/docker-images/plasma:user | ||
- name: ubuntu | ||
image: ubuntu:24.04 | ||
- name: opensuse | ||
image: opensuse/tumbleweed | ||
- name: fedora | ||
image: fedora | ||
plasma_version: [plasma5, plasma6] | ||
exclude: | ||
- os: | ||
image: invent-registry.kde.org/neon/docker-images/plasma:user | ||
plasma_version: plasma5 | ||
- os: | ||
image: ubuntu:24.04 | ||
plasma_version: plasma6 | ||
runs-on: ubuntu-latest | ||
name: ${{ matrix.os.name }}-${{ matrix.plasma_version }} | ||
container: | ||
image: ${{ matrix.os.image }} | ||
options: --user root | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: | | ||
README.md | ||
- name: Install dependencies | ||
shell: bash | ||
run: | | ||
echo "Dependencies for install-${{ matrix.os.name }}-${{ matrix.plasma_version }}" | ||
CMD=$(sed -n '/```bash install-${{ matrix.os.name }}-${{ matrix.plasma_version }}/,/```/p' README.md | head -n -1 | tail -n +2 |sed 's/sudo //') | ||
if [[ "${{ matrix.os.name }}" == "ubuntu" ]]; then | ||
apt update | ||
export DEBIAN_FRONTEND=noninteractive | ||
echo 'APT::Get::Assume-Yes "true";' >> /etc/apt/apt.conf | ||
elif [[ "${{ matrix.os.name }}" == "fedora" ]]; then | ||
echo "defaultyes=True" >> /etc/dnf/dnf.conf | ||
elif [[ "${{ matrix.os.name }}" == "opensuse" ]]; then | ||
zypper refresh | ||
CMD=$(echo $CMD | sed 's/zypper/zypper --non-interactive/') | ||
else | ||
echo "Unsupported OS: ${{ matrix.os.name }}" | ||
exit 1 | ||
fi | ||
echo "$CMD" | ||
eval $CMD | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- name: Create build directory | ||
run: mkdir -p build | ||
- name: Build and install | ||
id: build | ||
working-directory: build/ | ||
shell: bash | ||
run: | | ||
CMAKE_ARGS=".. -DCMAKE_BUILD_TYPE=RelWithDebInfo" | ||
if [[ -n "${{ inputs.publish-version }}" ]]; then | ||
CMAKE_ARGS="$CMAKE_ARGS -DCPACK_OS=${{ matrix.os.name }}" | ||
fi | ||
if [[ "${{ matrix.plasma_version }}" == "plasma6" ]]; then | ||
cmake $CMAKE_ARGS -DBUILD_WITH_QT6=ON | ||
else | ||
cmake $CMAKE_ARGS -DBUILD_WITH_QT6=OFF | ||
fi | ||
cmake --build . -j2 | ||
cmake --install . | ||
- name: Run tests | ||
working-directory: build/ | ||
run: ctest -V | ||
- name: CPack | ||
if: ${{ inputs.publish-version != "" }} | ||
Check failure on line 101 in .github/workflows/ci.yaml GitHub Actions / Build KRunner PluginsInvalid workflow file
|
||
shell: bash | ||
run: | | ||
cpack | tee cpack.out | ||
filepath=$(sed -nr 's/.*package: (.+) generated\./\1/p' cpack.out) | ||
echo "filepath=$filepath" >> "$GITHUB_OUTPUT" | ||
- uses: actions/upload-artifact@v4 | ||
if: ${{ inputs.publish-version != "" }} | ||
with: | ||
path: ${{ steps.build.outputs.filepath }} | ||