Skip to content

Build ONLYOFFICE_DesktopEditors-8.3.0-66 #83

Build ONLYOFFICE_DesktopEditors-8.3.0-66

Build ONLYOFFICE_DesktopEditors-8.3.0-66 #83

name: Update pull request for flatpak
run-name: Build ONLYOFFICE_DesktopEditors-${{ github.event.inputs.version }}-${{ github.event.inputs.build }}
on:
workflow_dispatch:
inputs:
version:
type: string
description: 'Version'
required: true
build:
description: 'Build number'
type: string
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v4
with:
ref: ${{ endsWith( github.event.inputs.version, '.0') == 1 && 'release' || 'hotfix' }}/v${{ github.event.inputs.version }}
- name: Replace Version and Build Number
id: repl
run: |
VERSION=${{ github.event.inputs.version }}
BUILD_NUMBER=${{ github.event.inputs.build }}
DATE=$(date --iso-8601)
#replace version
sed -i -r "/url/s/([0-9]+).([0-9]+).([0-9]+)/${VERSION}/" ./org.onlyoffice.desktopeditors.json
#replace build number
sed -i -r "/url/s/-([0-9]+)-/-${BUILD_NUMBER}-/" ./org.onlyoffice.desktopeditors.json
#replace link to archive to test
sed -i -e '/url/s|http://download.onlyoffice.com/install|https://s3.eu-west-1.amazonaws.com/repo-doc-onlyoffice-com|' ./org.onlyoffice.desktopeditors.json
sed -i -e '/url/s|editors/linux|linux/generic|' ./org.onlyoffice.desktopeditors.json
sed -i -e "/url/s|-x64|-${BUILD_NUMBER}-x86_64|" ./org.onlyoffice.desktopeditors.json
#download file from this url
FILE=$(cat ./org.onlyoffice.desktopeditors.json | grep "url" | awk -F'["]' '{print $(NF-1)}')
wget $FILE
SHASUM=$(sha256sum $(basename $FILE) | awk -F'[ ]' '{print $(1)}')
sed -i -r "/sha256/s|\"([0-9a-f]+)\"|\"${SHASUM}\"|" ./org.onlyoffice.desktopeditors.json
#replace matainfo
sed -i -r "/release version/s/([0-9]+).([0-9]+).([0-9]+)/${VERSION}/" ./org.onlyoffice.desktopeditors.metainfo.xml
sed -i -r "/release version/s/([0-9]+)-([0-9]+)-([0-9]+)/${DATE}/" ./org.onlyoffice.desktopeditors.metainfo.xml
#commit changes
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit -m "Update version to ${VERSION}-${BUILD_NUMBER}" -a
git push