Skip to content

Manual RPM Build Dispatch #2

Manual RPM Build Dispatch

Manual RPM Build Dispatch #2

name: Manual RPM Build Dispatch
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to RPM Build From'
required: true
tag:
description: 'Additional tag for the build (such as alpha, beta, etc.) - Optional'
default: ''
jobs:
manual-rpm-build-and-upload-artifact:
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.branch }}
- name: Prepare Suffix
id: suffix
if: ${{ github.event.inputs.tag != '' }}
run: echo suffix="-${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
- name: Build RPM
id: build_rpm
run: |
echo "Starting make rpm"
make rpm
echo "Make rpm completed"
- name: Finalize RPM
id: finalize_full_rpm_path
run: |
DATE=$(date +'%Y%m%d')
VERSION=$(jq -r '.version' < ./package.json)
RPM_BASE_VERSION=noobaa-core-${VERSION}-${DATE}
RPM_FULL_PATH="${RPM_BASE_VERSION}-${{ github.event.inputs.branch }}${{ steps.suffix.outputs.suffix }}.el9.x86_64.rpm"
echo "RPM FULL PATH=${RPM_FULL_PATH}"
cp ./build/rpm/${RPM_BASE_VERSION}.el9.x86_64.rpm ${RPM_FULL_PATH}
echo "rpm_full_path=${RPM_FULL_PATH}" >> $GITHUB_OUTPUT
- name: Upload artifact
uses: actions/upload-artifact@v1.0.0
with:
name: noobaa_rpm
path: ${{ steps.finalize_full_rpm_path.outputs.rpm_full_path }}