|
2 | 2 | # SPDX-License-Identifier: AGPL-3.0-or-later |
3 | 3 |
|
4 | 4 | name: Nextcloud release plan |
5 | | -description: Validate whether a Nextcloud app release is ready |
| 5 | +description: Build a read-only ReleasePlan v1 with the verified PHP release-tool. |
6 | 6 |
|
7 | 7 | inputs: |
8 | | - version: |
9 | | - description: Release version in MAJOR.MINOR.PATCH form |
10 | | - required: true |
11 | | - stable-branch: |
12 | | - description: Stable branch that is allowed to release |
| 8 | + branch: |
| 9 | + description: Release branch to plan. |
13 | 10 | required: true |
14 | | - milestone: |
15 | | - description: Milestone title that must be closed with no open issues |
| 11 | + ref: |
| 12 | + description: Optional planning ref or commit SHA. |
| 13 | + required: false |
| 14 | + default: '' |
| 15 | + version: |
| 16 | + description: Optional explicit release version override, with or without the configured tag prefix. |
16 | 17 | required: false |
17 | 18 | default: '' |
18 | | - blocker-queries: |
19 | | - description: JSON array of GitHub issue search fragments that must return zero open items |
| 19 | + channel: |
| 20 | + description: Release channel (alpha, beta, rc or final). |
20 | 21 | required: false |
21 | | - default: '[]' |
22 | | - appinfo-path: |
23 | | - description: Path to the Nextcloud app info.xml |
| 22 | + default: final |
| 23 | + mode: |
| 24 | + description: Release mode (normal or security). |
24 | 25 | required: false |
25 | | - default: appinfo/info.xml |
26 | | - changelog-path: |
27 | | - description: Path to the changelog |
| 26 | + default: normal |
| 27 | + safe-public-text: |
| 28 | + description: Optional explicitly public-safe release text. |
28 | 29 | required: false |
29 | | - default: CHANGELOG.md |
| 30 | + default: '' |
| 31 | + ignore-open-backport: |
| 32 | + description: Explicitly override matching open backport blockers. |
| 33 | + required: false |
| 34 | + default: 'false' |
| 35 | + create-follow-up-milestone: |
| 36 | + description: Request follow-up milestone creation in a later mutating stage. |
| 37 | + required: false |
| 38 | + default: 'false' |
| 39 | + config-path: |
| 40 | + description: Consumer release configuration path. |
| 41 | + required: false |
| 42 | + default: .nextcloud-release.yml |
30 | 43 | github-token: |
31 | | - description: GitHub token used for milestone and blocker checks |
| 44 | + description: GitHub token used for read-only planning API calls. |
32 | 45 | required: true |
33 | 46 |
|
| 47 | +outputs: |
| 48 | + plan: |
| 49 | + description: ReleasePlan v1 JSON. |
| 50 | + value: ${{ steps.plan.outputs.plan }} |
| 51 | + ready: |
| 52 | + description: Whether the plan is ready for the next stage. |
| 53 | + value: ${{ steps.plan.outputs.ready }} |
| 54 | + tool-version: |
| 55 | + description: Exact release-tool version used for planning. |
| 56 | + value: ${{ steps.setup.outputs.version }} |
| 57 | + |
34 | 58 | runs: |
35 | 59 | using: composite |
36 | 60 | steps: |
37 | | - - name: Build release plan |
| 61 | + - id: setup |
| 62 | + name: Setup release-tool |
| 63 | + uses: $/actions/setup-release-tool |
| 64 | + with: |
| 65 | + version: '0.2.0' |
| 66 | + |
| 67 | + - id: plan |
| 68 | + name: Build ReleasePlan v1 |
38 | 69 | shell: bash |
39 | 70 | env: |
40 | 71 | GITHUB_TOKEN: ${{ inputs.github-token }} |
41 | | - RELEASE_PLAN_VERSION: ${{ inputs.version }} |
42 | | - RELEASE_PLAN_STABLE_BRANCH: ${{ inputs.stable-branch }} |
43 | | - RELEASE_PLAN_MILESTONE: ${{ inputs.milestone }} |
44 | | - RELEASE_PLAN_BLOCKER_QUERIES: ${{ inputs.blocker-queries }} |
45 | | - RELEASE_PLAN_APPINFO_PATH: ${{ inputs.appinfo-path }} |
46 | | - RELEASE_PLAN_CHANGELOG_PATH: ${{ inputs.changelog-path }} |
47 | | - run: python3 "$GITHUB_ACTION_PATH/../../scripts/release_plan.py" |
| 72 | + RELEASE_TOOL_PATH: ${{ steps.setup.outputs.path }} |
| 73 | + RELEASE_TOOL_VERSION: ${{ steps.setup.outputs.version }} |
| 74 | + RELEASE_BRANCH: ${{ inputs.branch }} |
| 75 | + RELEASE_REF: ${{ inputs.ref }} |
| 76 | + RELEASE_VERSION: ${{ inputs.version }} |
| 77 | + RELEASE_CHANNEL: ${{ inputs.channel }} |
| 78 | + RELEASE_MODE: ${{ inputs.mode }} |
| 79 | + RELEASE_SAFE_PUBLIC_TEXT: ${{ inputs.safe-public-text }} |
| 80 | + RELEASE_IGNORE_OPEN_BACKPORT: ${{ inputs.ignore-open-backport }} |
| 81 | + RELEASE_CREATE_FOLLOW_UP_MILESTONE: ${{ inputs.create-follow-up-milestone }} |
| 82 | + RELEASE_CONFIG_PATH: ${{ inputs.config-path }} |
| 83 | + run: | |
| 84 | + set -euo pipefail |
| 85 | +
|
| 86 | + args=( |
| 87 | + release:plan |
| 88 | + --config "${RELEASE_CONFIG_PATH}" |
| 89 | + --root . |
| 90 | + --branch "${RELEASE_BRANCH}" |
| 91 | + --channel "${RELEASE_CHANNEL}" |
| 92 | + --mode "${RELEASE_MODE}" |
| 93 | + --json |
| 94 | + ) |
| 95 | +
|
| 96 | + if [[ -n "${RELEASE_REF}" ]]; then |
| 97 | + args+=(--ref "${RELEASE_REF}") |
| 98 | + fi |
| 99 | + if [[ -n "${RELEASE_VERSION}" ]]; then |
| 100 | + args+=(--release-version "${RELEASE_VERSION}") |
| 101 | + fi |
| 102 | + if [[ -n "${RELEASE_SAFE_PUBLIC_TEXT}" ]]; then |
| 103 | + args+=(--safe-public-text "${RELEASE_SAFE_PUBLIC_TEXT}") |
| 104 | + fi |
| 105 | + if [[ "${RELEASE_IGNORE_OPEN_BACKPORT}" == "true" ]]; then |
| 106 | + args+=(--ignore-open-backport) |
| 107 | + fi |
| 108 | + if [[ "${RELEASE_CREATE_FOLLOW_UP_MILESTONE}" == "true" ]]; then |
| 109 | + args+=(--create-follow-up-milestone) |
| 110 | + fi |
| 111 | +
|
| 112 | + plan_file="${RUNNER_TEMP}/release-plan.json" |
| 113 | + set +e |
| 114 | + php "${RELEASE_TOOL_PATH}" "${args[@]}" > "${plan_file}" |
| 115 | + exit_code=$? |
| 116 | + set -e |
| 117 | +
|
| 118 | + if [[ "${exit_code}" -ne 0 && "${exit_code}" -ne 3 ]]; then |
| 119 | + cat "${plan_file}" |
| 120 | + exit "${exit_code}" |
| 121 | + fi |
| 122 | +
|
| 123 | + ready="$(php -r ' |
| 124 | + $plan = json_decode(file_get_contents($argv[1]), true, 512, JSON_THROW_ON_ERROR); |
| 125 | + echo !empty($plan["ready"]) ? "true" : "false"; |
| 126 | + ' "${plan_file}")" |
| 127 | +
|
| 128 | + delimiter="release-plan-${RANDOM}-${RANDOM}" |
| 129 | + { |
| 130 | + echo "plan<<${delimiter}" |
| 131 | + cat "${plan_file}" |
| 132 | + echo "${delimiter}" |
| 133 | + echo "ready=${ready}" |
| 134 | + } >> "${GITHUB_OUTPUT}" |
| 135 | +
|
| 136 | + { |
| 137 | + echo "## Release plan" |
| 138 | + echo |
| 139 | + php -r ' |
| 140 | + $plan = json_decode(file_get_contents($argv[1]), true, 512, JSON_THROW_ON_ERROR); |
| 141 | + printf("- Tool: release-tool %s\n", $argv[2]); |
| 142 | + printf("- Plan: `%s`\n", $plan["id"]); |
| 143 | + printf("- Branch: `%s`\n", $plan["branch"]); |
| 144 | + printf("- Planning base: `%s`\n", $plan["planning_base_sha"]); |
| 145 | + printf("- Version: `%s` -> `%s`\n", $plan["current_version"], $plan["proposed_version"]); |
| 146 | + printf("- Channel: `%s`\n", $plan["channel"]); |
| 147 | + printf("- Ready: **%s**\n", !empty($plan["ready"]) ? "yes" : "no"); |
| 148 | + foreach ($plan["warnings"] as $warning) { |
| 149 | + printf("- Warning: %s\n", str_replace(["\r", "\n"], " ", (string) $warning)); |
| 150 | + } |
| 151 | + ' "${plan_file}" "${RELEASE_TOOL_VERSION}" |
| 152 | + } >> "${GITHUB_STEP_SUMMARY}" |
| 153 | +
|
| 154 | + cat "${plan_file}" |
| 155 | +
|
| 156 | + exit "${exit_code}" |
0 commit comments