Skip to content

Commit

Permalink
Merge pull request #7866 from romayalon/romy-ppc64le-rpmm-action
Browse files Browse the repository at this point in the history
NSFS | NC | CI | Add architecture to RPM manual build github action
  • Loading branch information
romayalon authored Mar 6, 2024
2 parents baac99d + 1e6a51c commit 29fc24a
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/manual-build-rpm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ on:
options:
- '8'
- '9'
architecture:
type: choice
description: 'Architecture (options: linux/amd64 or linux/ppc64le) - Optional, default is linux/amd64'
default: 'linux/amd64'
options:
- 'linux/amd64'
- 'linux/ppc64le'

jobs:
manual-rpm-build-and-upload-artifact:
Expand All @@ -34,12 +41,25 @@ jobs:
- name: Prepare CENTOS base image version
id: centos_ver
run: echo "centos_ver=${{ github.event.inputs.centos_ver }}" >> $GITHUB_OUTPUT

- name: Prepare linux architecture
id: architecture
run: |
if [ "${{ github.event.inputs.architecture }}" == "linux/amd64" ]; then
ARCH_SUFFIX="x86_64"
echo "architecture=${ARCH_SUFFIX}" >> $GITHUB_OUTPUT
elif [ "${{ github.event.inputs.architecture }}" == "linux/ppc64le" ]; then
ARCH_SUFFIX="ppc64le"
echo "architecture=${ARCH_SUFFIX}" >> $GITHUB_OUTPUT
# enable cross-architecture builds
docker run --privileged --rm tonistiigi/binfmt --install all
fi
- name: Build RPM
id: build_rpm
run: |
echo "Starting make rpm"
make rpm CENTOS_VER=${{ steps.centos_ver.outputs.centos_ver }}
make rpm CENTOS_VER=${{ steps.centos_ver.outputs.centos_ver }} CONTAINER_PLATFORM=${{ github.event.inputs.architecture }}
echo "Make rpm completed"
- name: Finalize RPM
Expand All @@ -48,7 +68,8 @@ jobs:
DATE=$(date +'%Y%m%d')
VERSION=$(jq -r '.version' < ./package.json)
CENTOS_VER=${{ steps.centos_ver.outputs.centos_ver }}
RPM_SUFFIX=el${CENTOS_VER}.x86_64.rpm
ARCH=${{ steps.architecture.outputs.architecture }}
RPM_SUFFIX=el${CENTOS_VER}.${ARCH}.rpm
RPM_BASE_VERSION=noobaa-core-${VERSION}-${DATE}
RPM_FULL_PATH=${RPM_BASE_VERSION}-${{ github.event.inputs.branch }}${{ steps.suffix.outputs.suffix }}.${RPM_SUFFIX}
echo "rpm_full_path=${RPM_FULL_PATH}"
Expand Down

0 comments on commit 29fc24a

Please sign in to comment.