-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6c764ff
commit 10a3e96
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
--- | ||
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 |