From 1abd3e961f9c2f4eb35d2915c63ca54342586a17 Mon Sep 17 00:00:00 2001 From: Evgeniy Antonyuk Date: Mon, 23 Sep 2024 11:32:09 +0700 Subject: [PATCH] Fix packages build for the develop branch --- .github/workflows/build_packages.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_packages.yml b/.github/workflows/build_packages.yml index 66aff4f7e8..4bddf523cd 100644 --- a/.github/workflows/build_packages.yml +++ b/.github/workflows/build_packages.yml @@ -15,6 +15,9 @@ on: description: 'Branch for server repository' required: true default: 'develop' + push: + branches: + - bugfix/package-build concurrency: group: ${{ github.ref }} @@ -23,7 +26,7 @@ concurrency: env: PRODUCT: ${{ github.event.repository.name }} PRODUCT_LOW: echo ${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]' - PRODUCT_VERSION: echo ${{ github.ref }} | grep -oP '\d+\.\d+\.\d+' || echo '2.5.0' + PRODUCT_VERSION: echo ${{ github.ref }} | grep -oP '\d+\.\d+\.\d+' || echo '2.6.3' BUILD_NUMBER: ${{ github.run_number }} PACKAGE_DIRECTORY: "/home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}" BRANCH_BUILDTOOLS: ${{ github.event.inputs.branch-buildtools }} @@ -48,6 +51,13 @@ jobs: sudo rm -rf /usr/local/lib/android /opt/ghc sudo docker image prune --all --force + - name: Set default branches for push + if: github.event_name == 'push' + run: | + echo "BRANCH_BUILDTOOLS=bugfix/package-build" >> $GITHUB_ENV + echo "BRANCH_CLIENT=develop" >> $GITHUB_ENV + echo "BRANCH_SERVER=bugfix/package-build" >> $GITHUB_ENV + - name: Import GPG uses: crazy-max/ghaction-import-gpg@v5 id: gpg_step @@ -73,7 +83,10 @@ jobs: tr [:upper:] [:lower:])/$(lsb_release -rs)/packages-microsoft-prod.deb -O packages-microsoft-prod.deb sudo dpkg -i packages-microsoft-prod.deb curl -fsSL https://deb.nodesource.com/setup_20.x | sudo bash - - sudo apt install -y dotnet-sdk-8.0 yarn nodejs rename + sudo apt install -y dotnet-sdk-8.0 yarn nodejs rename unzip maven openjdk-21-jdk-headless + JAVA_PATH=$(find /usr/lib/jvm/ -name "java" -path "*java-${JAVA_VERSION}*" | head -1) + sudo update-alternatives --install /usr/bin/java java "$JAVA_PATH" 100 && sudo update-alternatives --set java "$JAVA_PATH" + echo "JAVA_HOME=$(dirname $(dirname "$JAVA_PATH"))" >> $GITHUB_ENV sudo npm install -g json if [[ "${{ matrix.packageType }}" == "rpm" ]]; then sudo apt install -y python3-rpm python3-pip @@ -89,9 +102,9 @@ jobs: wget -q -O ./debian/source/buildtools.tar.gz "https://github.com/ONLYOFFICE/$PRODUCT-buildtools/archive/${BRANCH_BUILDTOOLS}.tar.gz" wget -q -O ./debian/source/client.tar.gz "https://github.com/ONLYOFFICE/$PRODUCT-client/archive/${BRANCH_CLIENT}.tar.gz" wget -q -O ./debian/source/server.tar.gz "https://github.com/ONLYOFFICE/$PRODUCT-server/archive/${BRANCH_SERVER}.tar.gz" - wget -q -O ./debian/source/dictionaries.tar.gz "https://github.com/ONLYOFFICE/dictionaries/archive/master.tar.gz" wget -q -O ./debian/source/DocStore.tar.gz "https://github.com/ONLYOFFICE/document-templates/archive/main/community-server.tar.gz" wget -q -O ./debian/source/campaigns.tar.gz "https://github.com/ONLYOFFICE/ASC.Web.Campaigns/archive/master.tar.gz" + wget -q -O ./debian/source/plugins.tar.gz "https://github.com/ONLYOFFICE/$PRODUCT-plugins/archive/master.tar.gz" rename -f -v "s/product([^\/]*)$/$(${{ env.PRODUCT_LOW }})\$1/g" debian/* find debian/ -type f -exec sed -i "s/{{product}}/$(${{ env.PRODUCT_LOW }})/g" {} ';' @@ -105,9 +118,9 @@ jobs: wget -q -O ./SOURCES/buildtools.tar.gz "https://github.com/ONLYOFFICE/$PRODUCT-buildtools/archive/${BRANCH_BUILDTOOLS}.tar.gz" wget -q -O ./SOURCES/client.tar.gz "https://github.com/ONLYOFFICE/$PRODUCT-client/archive/${BRANCH_CLIENT}.tar.gz" wget -q -O ./SOURCES/server.tar.gz "https://github.com/ONLYOFFICE/$PRODUCT-server/archive/${BRANCH_SERVER}.tar.gz" - wget -q -O ./SOURCES/dictionaries.tar.gz "https://github.com/ONLYOFFICE/dictionaries/archive/master.tar.gz" wget -q -O ./SOURCES/DocStore.tar.gz "https://github.com/ONLYOFFICE/document-templates/archive/main/community-server.tar.gz" wget -q -O ./SOURCES/campaigns.tar.gz "https://github.com/ONLYOFFICE/ASC.Web.Campaigns/archive/master.tar.gz" + wget -q -O ./SOURCES/plugins.tar.gz "https://github.com/ONLYOFFICE/$PRODUCT-plugins/archive/master.tar.gz" mv ./SOURCES/product.rpmlintrc ./SOURCES/$(${{ env.PRODUCT_LOW }}).rpmlintrc sed -i -e '/BuildRequires/d' product.spec rpmbuild -D "packager Ascensio System SIA " \