2023-01-10 15:03:40 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
VERSION="$1"
|
|
|
|
RELEASE="$2"
|
|
|
|
PLUGINS="$3"
|
|
|
|
|
|
|
|
for PLUGIN_NAME in $PLUGINS; do
|
2023-01-17 11:47:42 +01:00
|
|
|
echo "::group::Packaging $PLUGIN_NAME"
|
2023-01-10 15:03:40 +01:00
|
|
|
|
2023-01-17 11:47:42 +01:00
|
|
|
PACKAGE_PATH=$PLUGIN_NAME
|
|
|
|
|
|
|
|
if [[ "$PLUGIN_NAME" =~ (.+)"=>"(.+) ]]; then
|
|
|
|
PACKAGE_PATH=$(echo ${BASH_REMATCH[1]})
|
|
|
|
PLUGIN_NAME=$(echo ${BASH_REMATCH[2]})
|
2023-01-10 15:03:40 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Process specfile
|
|
|
|
rm -f plugin.specfile
|
2023-01-17 11:47:42 +01:00
|
|
|
python3 .github/scripts/create-spec-file.py "$PACKAGE_PATH" "$PLUGIN_NAME" "$VERSION" "$RELEASE"
|
2023-01-10 15:03:40 +01:00
|
|
|
|
|
|
|
rm -rf $HOME/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
|
|
|
|
mkdir -p $HOME/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
|
|
|
|
|
|
|
|
mv build/$PLUGIN_NAME $PLUGIN_NAME-$VERSION
|
|
|
|
tar czf $PLUGIN_NAME-$VERSION.tar.gz $PLUGIN_NAME-$VERSION
|
|
|
|
mv $PLUGIN_NAME-$VERSION.tar.gz $HOME/rpmbuild/SOURCES/
|
|
|
|
|
|
|
|
cd $PLUGIN_NAME-$VERSION
|
|
|
|
rpmbuild -ba ../plugin.specfile
|
|
|
|
find $HOME/rpmbuild/RPMS -name *.rpm -exec mv {} /src/ \;
|
|
|
|
|
|
|
|
cd -
|
|
|
|
|
2023-01-17 11:47:42 +01:00
|
|
|
echo "::endgroup::"
|
2023-01-10 15:03:40 +01:00
|
|
|
done
|