Packaging #4
Workflow file for this run
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
--- | ||
Check failure on line 1 in .github/workflows/pack-rpm.yml GitHub Actions / RPM PackagesInvalid workflow file
|
||
name: RPM Packages | ||
on: | ||
workflow_dispatch: | ||
push: | ||
pull_request: | ||
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 |