Skip to content

Packaging

Packaging #2

Workflow file for this run

---

Check failure on line 1 in .github/workflows/pack-rpm.yml

View workflow run for this annotation

GitHub Actions / RPM Packages

Invalid workflow file

The workflow is not valid. .github/workflows/pack-rpm.yml: (Line: 20, Col: 14, Idx: 264) - (Line: 20, Col: 24, Idx: 274): While scanning a plain scalar, find unexpected ':'.
name: RPM Packages
on:
workflow_dispatch:
push:
pull_request:
branches:
- v11
- main
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
os: [rockylinux:8, rockylinux:9]
container:
image: ${{ matrix.image }}
steps:
- name: Install packages
run: |
dnf upgrade -y
dnf install -y cmake gcc-c++ ninja-build rpm-build git
- name: Checkout sources
uses: actions/checkout@v4
with:
submodules: true
- name: Configure CMake
run: |
cmake -B builds -S . -G Ninja -D CMAKE_BUILD_TYPE=Release -D CMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake
- name: Build
run: |
cmake --build builds --target khiopsdriver_file_gcs
- name: Build package with CPack
run: cd builds/ && cpack -G RPM
- name: Set environment variables
run: |
source /etc/os-release
echo "ID=$ID" >> "$GITHUB_ENV"
echo "VERSION_CODENAME=$VERSION_CODENAME" >> "$GITHUB_ENV"
- name: Rename packages with codename
run: |
source /etc/os-release
ARCH=$(arch)
cd build/packages
for filename in *.rpm
do
mv -v $filename ${filename%.${ARCH}*}.${{ env.VERSION_CODENAME }}.${ARCH}.rpm
done
- name: Upload the packages as artifacts
uses: actions/upload-artifact@v4
with:
# We add a `rpm-` prefix so we can later recover all artifacts with the pattern `rpm-*`
# Note: The more natural pattern `*-rpm` or `*` does not work
name: rpm-${{ env.ID }}-${{ env.VERSION_CODENAME }}
path: build/packages/*.rpm
if-no-files-found: error