Skip to content

Commit

Permalink
Fix packages build for the develop branch
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeniy-antonyuk committed Oct 1, 2024
1 parent 888f7d5 commit 1abd3e9
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/build_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ on:
description: 'Branch for server repository'
required: true
default: 'develop'
push:
branches:
- bugfix/package-build

concurrency:
group: ${{ github.ref }}
Expand All @@ -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 }}
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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" {} ';'
Expand All @@ -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 <[email protected]>" \
Expand Down

0 comments on commit 1abd3e9

Please sign in to comment.