# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors # SPDX-License-Identifier: AGPL-3.0-or-later name: Prepare release run-name: >- ${{ github.event_name == 'workflow_dispatch' && format('Prepare release · {0}', inputs.branch) || github.event_name == 'pull_request_target' && format('Finalize release · PR #{0}', github.event.pull_request.number) || github.event_name == 'release' && format('Verify release · {0}', github.event.release.tag_name) || 'Release automation' }} on: workflow_dispatch: inputs: branch: description: 'Stable branch to release, e.g. stable33. One branch per run. Guide: https://github.com/LibreSign/documentation/blob/main/developer_manual/release-process/preparing.rst' required: true type: string ref: description: Exact commit or tag to plan instead of branch HEAD. Leave blank to use the latest branch state. required: false type: string version: description: Force a version instead of the calculated one. Branch and version rules are still validated. required: false type: string channel: description: final for a normal release; alpha, beta or rc for a prerelease. required: true default: final type: choice options: - alpha - beta - rc - final ignore_open_backport: description: Allow release with a matching backport PR still open. Use only after reviewing the blocker. required: true default: false type: boolean create_follow_up_milestone: description: After release, create the next milestone and move remaining open items to it. required: true default: true type: boolean pull_request_target: types: [closed] release: types: [published] permissions: {} concurrency: group: release-automation-${{ github.repository }} cancel-in-progress: false jobs: prepare: name: Prepare release PR if: github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest timeout-minutes: 15 permissions: contents: read issues: read pull-requests: read steps: - name: Checkout selected release state uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false fetch-depth: 1 ref: ${{ inputs.ref != '' && inputs.ref || inputs.branch }} - name: Fetch selected release history shell: bash env: RELEASE_BRANCH: ${{ inputs.branch }} run: | set -euo pipefail git fetch --quiet --unshallow --prune origin "+refs/heads/${RELEASE_BRANCH}:refs/remotes/origin/${RELEASE_BRANCH}" "+refs/tags/*:refs/tags/*" - name: Fetch trusted release pipeline reference shell: bash run: | set -euo pipefail git fetch --quiet origin "+refs/heads/main:refs/remotes/origin/main" - name: Prepare release uses: LibreCodeCoop/release-tool/actions/prepare@51355769089a6796c23d6c966108afbdaf858c32 # v0.12.0 with: branch: ${{ inputs.branch }} ref: ${{ inputs.ref }} version: ${{ inputs.version }} channel: ${{ inputs.channel }} ignore-open-backport: ${{ inputs.ignore_open_backport }} create-follow-up-milestone: ${{ inputs.create_follow_up_milestone }} config-path: .nextcloud-release.yml actor: ${{ github.actor }} github-token: ${{ secrets.GITHUB_TOKEN }} app-private-key: ${{ secrets.WORKFLOW_SYNC_APP_PRIVATE_KEY }} pipeline-reference-ref: refs/remotes/origin/main post_merge: name: Finalize release and prepare draft if: >- github.event_name == 'pull_request_target' && github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release-tool/') && contains(github.event.pull_request.body, '