From 24fcc1142d94f58243dc532692adb32dd467b1c8 Mon Sep 17 00:00:00 2001 From: danilapog Date: Tue, 2 Jun 2026 14:37:31 +0000 Subject: [PATCH 1/2] Allow selecting editions to release via dynamic matrix Co-authored-by: danilapog Co-committed-by: danilapog --- .github/workflows/stable-build.yml | 57 +++++++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 5 deletions(-) diff --git a/.github/workflows/stable-build.yml b/.github/workflows/stable-build.yml index 435aede..fbff25c 100644 --- a/.github/workflows/stable-build.yml +++ b/.github/workflows/stable-build.yml @@ -1,6 +1,6 @@ ### This workflow setup instance then build and push images ### name: Multi-arch build stable -run-name: ${{ inputs.tag }} (${{ inputs.release_number }}) +run-name: ${{ inputs.tag }} (${{ inputs.release_number }}) — ${{ inputs.community && 'CE ' || '' }}${{ inputs.enterprise && 'EE ' || '' }}${{ inputs.developer && 'DE' || '' }} on: workflow_dispatch: @@ -19,6 +19,18 @@ on: type: boolean required: true default: true + community: + type: boolean + description: 'Release Community Edition' + default: true + enterprise: + type: boolean + description: 'Release Enterprise Edition' + default: true + developer: + type: boolean + description: 'Release Developer Edition' + default: true env: COMPANY_NAME: "onlyoffice" @@ -28,14 +40,45 @@ env: LATEST: ${{ github.event.inputs.latest }} jobs: + setup: + name: "Prepare editions matrix" + runs-on: ubuntu-latest + outputs: + editions: ${{ steps.set.outputs.editions }} + editions_ucs: ${{ steps.set.outputs.editions_ucs }} + steps: + - name: Build editions list + id: set + shell: bash + env: + INPUT_C: ${{ github.event.inputs.community }} + INPUT_E: ${{ github.event.inputs.enterprise }} + INPUT_D: ${{ github.event.inputs.developer }} + run: | + set -eux + editions=$(jq -nc \ + --argjson c "$INPUT_C" \ + --argjson e "$INPUT_E" \ + --argjson d "$INPUT_D" \ + '[ if $c then "" else empty end, + if $e then "-ee" else empty end, + if $d then "-de" else empty end ]') + editions_ucs=$(echo "$editions" | jq -c 'map(select(. != "-de"))') + echo "editions=$editions" >> "$GITHUB_OUTPUT" + echo "editions_ucs=$editions_ucs" >> "$GITHUB_OUTPUT" + echo "Matrix editions: $editions" + echo "Matrix editions (UCS): $editions_ucs" + build: name: "Release image: DocumentServer${{ matrix.edition }}" runs-on: ubuntu-latest + needs: [setup] + if: ${{ needs.setup.outputs.editions != '[]' }} strategy: fail-fast: false matrix: images: ["documentserver-stable"] - edition: ["", "-ee", "-de"] + edition: ${{ fromJSON(needs.setup.outputs.editions) }} steps: - name: Checkout code uses: actions/checkout@v4 @@ -83,6 +126,8 @@ jobs: release_4enterprise: name: "Release image: onlyoffice4enterprise" runs-on: ubuntu-latest + needs: [setup] + if: ${{ github.event.inputs.enterprise == 'true' }} steps: - name: Checkout code uses: actions/checkout@v4 @@ -109,13 +154,13 @@ jobs: build-nonexample: name: "Release image: DocumentServer${{ matrix.edition }}-nonExample" runs-on: ubuntu-latest - needs: [build] + needs: [build, setup] if: ${{ false }} strategy: fail-fast: false matrix: images: ["documentserver-nonexample"] - edition: ["", "-ee", "-de"] + edition: ${{ fromJSON(needs.setup.outputs.editions) }} steps: - name: Checkout code uses: actions/checkout@v4 @@ -146,10 +191,12 @@ jobs: build-ucs-ubuntu20: name: "Release image: DocumentServer${{ matrix.edition }}-ucs" runs-on: ubuntu-latest + if: ${{ needs.setup.outputs.editions_ucs != '[]' }} + needs: [setup] strategy: fail-fast: false matrix: - edition: ["", "-ee"] + edition: ${{ fromJSON(needs.setup.outputs.editions_ucs) }} platform: ["amd64"] steps: - name: Checkout code From a4c4c802bbba417cc82a07b55a03e8a9276ec362 Mon Sep 17 00:00:00 2001 From: danilapog Date: Wed, 3 Jun 2026 14:29:51 +0300 Subject: [PATCH 2/2] Refactor(ci): fold developers editions into enterprise toogle --- .github/workflows/stable-build.yml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/workflows/stable-build.yml b/.github/workflows/stable-build.yml index fbff25c..8f08461 100644 --- a/.github/workflows/stable-build.yml +++ b/.github/workflows/stable-build.yml @@ -1,6 +1,6 @@ ### This workflow setup instance then build and push images ### name: Multi-arch build stable -run-name: ${{ inputs.tag }} (${{ inputs.release_number }}) — ${{ inputs.community && 'CE ' || '' }}${{ inputs.enterprise && 'EE ' || '' }}${{ inputs.developer && 'DE' || '' }} +run-name: ${{ inputs.tag }} (${{ inputs.release_number }}) — ${{ inputs.community && 'CE ' || '' }}${{ inputs.enterprise && 'EE DE' || '' }} on: workflow_dispatch: @@ -25,11 +25,7 @@ on: default: true enterprise: type: boolean - description: 'Release Enterprise Edition' - default: true - developer: - type: boolean - description: 'Release Developer Edition' + description: 'Release Enterprise editions (-ee and -de)' default: true env: @@ -53,16 +49,13 @@ jobs: env: INPUT_C: ${{ github.event.inputs.community }} INPUT_E: ${{ github.event.inputs.enterprise }} - INPUT_D: ${{ github.event.inputs.developer }} run: | set -eux editions=$(jq -nc \ --argjson c "$INPUT_C" \ --argjson e "$INPUT_E" \ - --argjson d "$INPUT_D" \ '[ if $c then "" else empty end, - if $e then "-ee" else empty end, - if $d then "-de" else empty end ]') + if $e then ("-ee", "-de") else empty end ]') editions_ucs=$(echo "$editions" | jq -c 'map(select(. != "-de"))') echo "editions=$editions" >> "$GITHUB_OUTPUT" echo "editions_ucs=$editions_ucs" >> "$GITHUB_OUTPUT"