Skip to content

feat(workflows): add GitHub Actions workflow for CLI release candidates#1056

Closed
jakobmoellerdev wants to merge 1 commit into
open-component-model:mainfrom
jakobmoellerdev:cli-release-candidates
Closed

feat(workflows): add GitHub Actions workflow for CLI release candidates#1056
jakobmoellerdev wants to merge 1 commit into
open-component-model:mainfrom
jakobmoellerdev:cli-release-candidates

Conversation

@jakobmoellerdev

Copy link
Copy Markdown
Member

What this does

  • Introduces a new GitHub Actions workflow file, release-candidate-cli.yml, to automate the creation of CLI release candidates.
  • Allows triggering the workflow manually via workflow_dispatch with branch and dry run inputs.
  • Includes automated version computation, changelog generation, artifact building, artifact attestation, GitHub prerelease creation, and OCI image push to GHCR.

Why this is needed

This workflow streamlines the process of creating CLI release candidates by automating critical steps, ensuring reproducibility and reducing manual effort. It also standardizes versioning and artifact publishing for better release management.

Which issue(s) this PR fixes

fix open-component-model/ocm-project#699

@github-actions github-actions Bot added kind/feature new feature, enhancement, improvement, extension size/m Medium component/github-actions Changes on GitHub Actions or within `.github/` directory labels Oct 17, 2025
#### What this does
- Introduces a new GitHub Actions workflow file, `release-candidate-cli.yml`, to automate the creation of CLI release candidates.
- Allows triggering the workflow manually via `workflow_dispatch` with branch and dry run inputs.
- Includes automated version computation, changelog generation, artifact building, artifact attestation, GitHub prerelease creation, and OCI image push to GHCR.

#### Why this is needed
This workflow streamlines the process of creating CLI release candidates by automating critical steps, ensuring reproducibility and reducing manual effort. It also standardizes versioning and artifact publishing for better release management.

Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
COMPONENT_PATH: ${{ env.COMPONENT_PATH }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using already existing actions like "paulhatch/semantic-version"?

      - name: Compute new RC version
        id: compute
        uses: paulhatch/semantic-version@v5
        with:
          tag_prefix: "cli/v"
          major_pattern: "(MAJOR)"
          minor_pattern: "(MINOR)"
          version_format: "${major}.${minor}.${patch}-rc.${increment}"
          change_path: "cli/**"
          enable_prerelease_mode: true
...

This code is quite lengthy.

Alternatively, maybe we should host our own actions..

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the action you linked needs a bit more configuration due to https://github.com/PaulHatch/semantic-version/blob/master/guide.md#branch--tag-versioning but I will try. I agree the code is cumbersome

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried a lot but ultimately failed. mainly because:

  • the action you linked needs to have an initial tag for the branch cutoff. I believe we do not have this.
  • the action you linked does not iterate RCs per run, but instead iterates on conventional commit formats or patterns (like you wrote). I dont believe we want that but happy to discuss.

I only got it to more or less get a calculation okay running with avoiding major breaks, minor breaks and while taking into account that incremenet is the number of commits on the branch since the last tag. not sure what to think of this

core.setOutput("changelog_b64", encoded);
await core.summary.addRaw(log).write();

- name: Set up Docker Buildx

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To ensure we use the same actions each time we build, we may want to consider extracting "build" steps into a dedicated workflow and including it here and there.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a shared build workflow with 2 steps is probably a bit overkill and using workflow_call has its own caveats. I will experiment nevertheless

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will follow nearly the same steps for CLI and Controller for main (dev), RCs, and final releases.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while I agree I want to move step by step. The actions are quite large as is and I simply dont have capacity to get something much more complex out of the door. Im happy to discuss revisiting this of course!

Comment thread .github/workflows/release-candidate-cli.yml
Comment thread .github/workflows/release-candidate-cli.yml
jakobmoellerdev added a commit that referenced this pull request Oct 20, 2025
#### What this PR does / why we need it:

- Introduced `Containerfile` to build scratch-based multi-arch container
images for the CLI.
- Added `build/multiarch/image` task to generate OCI-compatible
multi-arch container images.
- Adjusted `Taskfile.yml` to support multi-arch builds, leveraging
Docker Buildx.
- Improved task dependencies to ensure dependencies are downloaded
before builds.
- Modified resource identity names to reflect new multi-arch CLI
structure.

#### Why:

This enables the CLI to be distributed as platform-compatible container
images, improving accessibility across diverse environments. The
capability aligns with modern multi-arch support best practices.

requirement as prep for
#1056

Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
workflow_dispatch:
inputs:
branch:
description: "Branch to cut to, must match regex releases/v0.[0-9]+"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this workflow will be called only on-demand, which means every other commit will not be tested. How about running "dry run" each time?

return;
}

const branchMatch = branch.match(/^releases\/v(0\.\d+)/);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For cleaner code, I would move these two checks (branch name, go.mod) into individual steps. Of course, it is a minor thing.

bump = "none";
pat = 0;
rc = 1;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps moving this JavaScript code to a file and executing it from that step?
This will simplify testing this code locally.

@jakobmoellerdev

Copy link
Copy Markdown
Member Author

I will rework this action and open up again when i split it. not worth reviewing further for now. Thanks for the feedback @piotrjanik

morri-son pushed a commit to morri-son/open-component-model that referenced this pull request Oct 23, 2025
…component-model#1058)

#### What this PR does / why we need it:

- Introduced `Containerfile` to build scratch-based multi-arch container
images for the CLI.
- Added `build/multiarch/image` task to generate OCI-compatible
multi-arch container images.
- Adjusted `Taskfile.yml` to support multi-arch builds, leveraging
Docker Buildx.
- Improved task dependencies to ensure dependencies are downloaded
before builds.
- Modified resource identity names to reflect new multi-arch CLI
structure.

#### Why:

This enables the CLI to be distributed as platform-compatible container
images, improving accessibility across diverse environments. The
capability aligns with modern multi-arch support best practices.

requirement as prep for
open-component-model#1056

Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/github-actions Changes on GitHub Actions or within `.github/` directory kind/feature new feature, enhancement, improvement, extension size/m Medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create Github workflow for creation of Release Candidates

2 participants