From 9ecdbdc06027ade6c3c9124344f68204e358eab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20M=C3=B6ller?= Date: Thu, 21 Aug 2025 19:31:26 +0200 Subject: [PATCH 01/14] chore: setup draft release for ocm cli MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakob Möller --- .github/workflows/cli.yml | 44 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 091450c35..8e5cd73e2 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -31,4 +31,48 @@ jobs: run: task cli:generate/ctf - name: Verify run: task cli:verify/ctf + - name: Extract Component Descriptor + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + working-directory: cli/tmp + run: | + ./bin/ocm get cv \ + ./transport-archive//ocm.software/cli \ + --logoutput stderr \ + -oyaml > descriptor.yaml + - name: Generate Draft Release Notes + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + working-directory: cli/tmp + run: | + cat < release-notes.md + # Open Component Model CLI – Latest (Unstable) Release + This is a draft release of the Open Component Model CLI, generated from the latest commit on the \`main\` branch. + + **Note:** The component descriptor included here is not yet published as a Component Transport Format (CTF). This will be supported in future releases. + +
+ component-descriptor.yaml + + \`\`\`yaml + $(cat descriptor.yaml) + \`\`\` + +
+ EOF + - name: Create draft release + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + uses: softprops/action-gh-release@v2 + with: + tag_name: cli/latest + name: "Latest CLI (draft)" + draft: true + body_path: cli/tmp/release-notes.md + fail_on_unmatched_files: true + preserve_order: true + files: | + cli/tmp/descriptor.yaml + cli/tmp/bin/ocm-linux-* + cli/tmp/bin/ocm-darwin-* + cli/tmp/bin/ocm-windows-* + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 7417c2b79c207cff055d312767bacb4bf5fe11dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20M=C3=B6ller?= Date: Thu, 21 Aug 2025 20:06:31 +0200 Subject: [PATCH 02/14] chore: setup draft release for ocm cli MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakob Möller --- .github/workflows/cli.yml | 50 +++++++++++++++++++++++++++++++++------ 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 8e5cd73e2..1f65e1bbd 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -17,6 +17,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + fetch-depth: 0 - name: Setup Go (required for CLI build) uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 with: @@ -38,23 +40,58 @@ jobs: ./bin/ocm get cv \ ./transport-archive//ocm.software/cli \ --logoutput stderr \ - -oyaml > descriptor.yaml + -oyaml > component-descriptor.yaml + + yq .component.version component-descriptor.yaml > component-descriptor-version.txt + + - name: changelog with git-cliff + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + uses: orhun/git-cliff-action@v4 + id: git-cliff + with: + args: | + --exclude-path ** --include-path cli/** + env: + OUTPUT: CHANGELOG.md - name: Generate Draft Release Notes if: github.event_name == 'push' && github.ref == 'refs/heads/main' working-directory: cli/tmp run: | cat < release-notes.md - # Open Component Model CLI – Latest (Unstable) Release + # $(cat component-descriptor-version.txt) - This is a draft release of the Open Component Model CLI, generated from the latest commit on the \`main\` branch. + This is a draft release of the next generation Open Component Model CLI, generated from the latest commit on the \`main\` branch. **Note:** The component descriptor included here is not yet published as a Component Transport Format (CTF). This will be supported in future releases. + **Disclaimer:** This is an unstable release and should not be used in production. It has not been signed and is not verified. + + ## Getting Started + + 1. Download the latest CLI build from the release assets of this draft for your architecture. + 2. Verify it works (you may need to add ocm to your PATH or make it executable): + \`\`\`sh + ocm version + \`\`\` + 3. Explore the available commands in this build: + \`\`\`sh + ocm --help + \`\`\` + + For more usage examples, see the current [OCM Development Documentation](https://ocm.software/dev/). + +
+ CHANGELOG.md + + $(cat CHANGELOG.md) + +
+
component-descriptor.yaml \`\`\`yaml - $(cat descriptor.yaml) + $(cat component-descriptor.yaml) \`\`\`
@@ -63,14 +100,13 @@ jobs: if: github.event_name == 'push' && github.ref == 'refs/heads/main' uses: softprops/action-gh-release@v2 with: - tag_name: cli/latest - name: "Latest CLI (draft)" + name: "OCM CLI – Latest (Unstable) Release" draft: true body_path: cli/tmp/release-notes.md fail_on_unmatched_files: true preserve_order: true files: | - cli/tmp/descriptor.yaml + cli/tmp/component-descriptor.yaml cli/tmp/bin/ocm-linux-* cli/tmp/bin/ocm-darwin-* cli/tmp/bin/ocm-windows-* From 7140baccbbb43e7cff140613b8deb0126c32fc8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20M=C3=B6ller?= Date: Thu, 21 Aug 2025 20:33:23 +0200 Subject: [PATCH 03/14] chore: setup draft release for ocm cli MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakob Möller --- .github/workflows/cli.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 1f65e1bbd..5bce253aa 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -50,7 +50,7 @@ jobs: id: git-cliff with: args: | - --exclude-path ** --include-path cli/** + --include-path "cli/**" --exclude-path "bindings/**/*" --tag-pattern cli/** env: OUTPUT: CHANGELOG.md - name: Generate Draft Release Notes From 2477e7282bc415269bce8a7fca29c19dd1c2b828 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20M=C3=B6ller?= Date: Thu, 21 Aug 2025 20:38:55 +0200 Subject: [PATCH 04/14] chore: setup draft release for ocm cli MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakob Möller --- .github/workflows/cli.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 5bce253aa..43da66322 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -4,11 +4,13 @@ on: branches: - main paths: + - .github/workflows/cli.yml - cli/** pull_request: branches: - main paths: + - .github/workflows/cli.yml - cli/** jobs: CTF: From 9ca04ee2b813dc31c4d72a7f73814259ce6eea5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20M=C3=B6ller?= Date: Thu, 21 Aug 2025 20:42:52 +0200 Subject: [PATCH 05/14] chore: setup draft release for ocm cli MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakob Möller --- .github/workflows/cli.yml | 46 ++++++++++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 43da66322..b764beca9 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -2,41 +2,66 @@ name: CLI on: push: branches: - - main + - main paths: - .github/workflows/cli.yml - cli/** pull_request: branches: - - main + - main paths: - .github/workflows/cli.yml - cli/** + jobs: - CTF: - name: CTF + build: + name: Build and Verify runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 0 + - name: Setup Go (required for CLI build) uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 with: go-version-file: cli/go.mod cache-dependency-path: cli/go.sum + - name: Install Task uses: arduino/setup-task@v2 with: version: 3.x repo-token: ${{ secrets.GITHUB_TOKEN }} + - name: Generate run: task cli:generate/ctf + - name: Verify run: task cli:verify/ctf + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: cli-build-${{ github.run_id }} + if-no-files-found: error + path: | + cli/tmp/** + + release: + name: Draft Release + needs: build + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + steps: + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: cli-build + path: cli/tmp + - name: Extract Component Descriptor - if: github.event_name == 'push' && github.ref == 'refs/heads/main' working-directory: cli/tmp run: | ./bin/ocm get cv \ @@ -47,7 +72,6 @@ jobs: yq .component.version component-descriptor.yaml > component-descriptor-version.txt - name: changelog with git-cliff - if: github.event_name == 'push' && github.ref == 'refs/heads/main' uses: orhun/git-cliff-action@v4 id: git-cliff with: @@ -55,8 +79,8 @@ jobs: --include-path "cli/**" --exclude-path "bindings/**/*" --tag-pattern cli/** env: OUTPUT: CHANGELOG.md + - name: Generate Draft Release Notes - if: github.event_name == 'push' && github.ref == 'refs/heads/main' working-directory: cli/tmp run: | cat < release-notes.md @@ -98,8 +122,8 @@ jobs: EOF + - name: Create draft release - if: github.event_name == 'push' && github.ref == 'refs/heads/main' uses: softprops/action-gh-release@v2 with: name: "OCM CLI – Latest (Unstable) Release" @@ -114,3 +138,9 @@ jobs: cli/tmp/bin/ocm-windows-* env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Delete artifact + if: always() + uses: geekyeggo/delete-artifact@v5 + with: + name: cli-build-${{ github.run_id }} \ No newline at end of file From fbc439ddbe01c17e58f4e1e6f36a9e7e197197f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20M=C3=B6ller?= Date: Thu, 21 Aug 2025 20:44:46 +0200 Subject: [PATCH 06/14] chore: setup draft release for ocm cli MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakob Möller --- .github/workflows/cli.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index b764beca9..cd616efff 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -76,9 +76,7 @@ jobs: id: git-cliff with: args: | - --include-path "cli/**" --exclude-path "bindings/**/*" --tag-pattern cli/** - env: - OUTPUT: CHANGELOG.md + --include-path "cli/**" --exclude-path "bindings/**/*" --tag-pattern cli/** -o cli/tmp/CHANGELOG.md - name: Generate Draft Release Notes working-directory: cli/tmp From 2b93beca9f8ba116e199bca03ddccf8e86c3dce1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20M=C3=B6ller?= Date: Thu, 21 Aug 2025 20:48:47 +0200 Subject: [PATCH 07/14] chore: setup draft release for ocm cli MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakob Möller --- .github/workflows/cli.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index cd616efff..2e705a67b 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -58,7 +58,7 @@ jobs: - name: Download build artifacts uses: actions/download-artifact@v4 with: - name: cli-build + name: cli-build-${{ github.run_id }} path: cli/tmp - name: Extract Component Descriptor @@ -86,9 +86,8 @@ jobs: This is a draft release of the next generation Open Component Model CLI, generated from the latest commit on the \`main\` branch. - **Note:** The component descriptor included here is not yet published as a Component Transport Format (CTF). This will be supported in future releases. - - **Disclaimer:** This is an unstable release and should not be used in production. It has not been signed and is not verified. + > ⚠️ **Disclaimer:** This build is **unstable** and not intended for production use. + > It is unsigned, unverified, and the component descriptor is **not yet published** as a Component Transport Format (CTF). CTF support will be added in a future release. ## Getting Started @@ -103,6 +102,9 @@ jobs: \`\`\` For more usage examples, see the current [OCM Development Documentation](https://ocm.software/dev/). + To engage with us, visit the [OCM Community](https://ocm.software/dev/community/engagement/). + + ## Additional Information
CHANGELOG.md From 8455634e8a07a716418904c69c42cbc31f471f91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20M=C3=B6ller?= Date: Thu, 21 Aug 2025 20:50:33 +0200 Subject: [PATCH 08/14] chore: setup draft release for ocm cli MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakob Möller --- .github/workflows/cli.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 2e705a67b..548b581af 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -41,7 +41,8 @@ jobs: - name: Verify run: task cli:verify/ctf - - name: Upload build artifacts + - name: Upload build artifacts (for release) + if: github.event_name == 'push' && github.ref == 'refs/heads/main' uses: actions/upload-artifact@v4 with: name: cli-build-${{ github.run_id }} From 31ebcd6a8c8d46f9e6a554bdf3e7f34f6d633340 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20M=C3=B6ller?= Date: Thu, 21 Aug 2025 20:52:10 +0200 Subject: [PATCH 09/14] chore: setup draft release for ocm cli MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakob Möller --- .github/workflows/cli.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 548b581af..7d5906aab 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -65,6 +65,7 @@ jobs: - name: Extract Component Descriptor working-directory: cli/tmp run: | + chmod +x ./bin/ocm ./bin/ocm get cv \ ./transport-archive//ocm.software/cli \ --logoutput stderr \ From 70296be1885ed11c572ae8d3d58eea4b0f733842 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20M=C3=B6ller?= Date: Thu, 21 Aug 2025 20:56:42 +0200 Subject: [PATCH 10/14] chore: setup draft release for ocm cli MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakob Möller --- .github/workflows/cli.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 7d5906aab..33a507e9d 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -20,8 +20,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - fetch-depth: 0 - name: Setup Go (required for CLI build) uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 @@ -56,6 +54,11 @@ jobs: if: github.event_name == 'push' && github.ref == 'refs/heads/main' runs-on: ubuntu-latest steps: + - name: Checkout + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + sparse-checkout: cli + fetch-depth: 0 - name: Download build artifacts uses: actions/download-artifact@v4 with: From ce6c531c05617f11293e92d614b2f6d3e247b982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20M=C3=B6ller?= Date: Thu, 21 Aug 2025 21:03:12 +0200 Subject: [PATCH 11/14] chore: setup draft release for ocm cli MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakob Möller --- .github/workflows/cli.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 33a507e9d..9e2541bb5 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -81,7 +81,7 @@ jobs: id: git-cliff with: args: | - --include-path "cli/**" --exclude-path "bindings/**/*" --tag-pattern cli/** -o cli/tmp/CHANGELOG.md + --include-path "cli/**" --exclude-path "bindings/**/*" --tag-pattern "cli/**" -o cli/tmp/CHANGELOG.md - name: Generate Draft Release Notes working-directory: cli/tmp From d574bb0b66ac2be5c9b4c75b6dace1140942bf59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20M=C3=B6ller?= Date: Thu, 21 Aug 2025 21:07:27 +0200 Subject: [PATCH 12/14] chore: setup draft release for ocm cli MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakob Möller --- .github/workflows/cli.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 9e2541bb5..90dae9f59 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -81,7 +81,11 @@ jobs: id: git-cliff with: args: | - --include-path "cli/**" --exclude-path "bindings/**/*" --tag-pattern "cli/**" -o cli/tmp/CHANGELOG.md + --include-path "cli/**" \ + --exclude-path "bindings/**/*" \ + --tag-pattern "cli/**" \ + -o cli/tmp/CHANGELOG.md \ + --github-token ${{ secrets.GITHUB_TOKEN }} - name: Generate Draft Release Notes working-directory: cli/tmp @@ -89,7 +93,7 @@ jobs: cat < release-notes.md # $(cat component-descriptor-version.txt) - This is a draft release of the next generation Open Component Model CLI, generated from the latest commit on the \`main\` branch. + This is a draft release of the next generation Open Component Model CLI, generated from the [latest commit at \`main\`](https://github.com/open-component-model/open-component-model/tree/main/cli). > ⚠️ **Disclaimer:** This build is **unstable** and not intended for production use. > It is unsigned, unverified, and the component descriptor is **not yet published** as a Component Transport Format (CTF). CTF support will be added in a future release. From eb477433f949c1f4c7c6573b5ab5f53a1cc50373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20M=C3=B6ller?= Date: Thu, 21 Aug 2025 21:10:05 +0200 Subject: [PATCH 13/14] chore: setup draft release for ocm cli MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakob Möller --- renovate.json5 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/renovate.json5 b/renovate.json5 index 99572184e..d0f1bd047 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -6,7 +6,8 @@ 'security:openssf-scorecard', 'helpers:pinGitHubActionDigests', ':rebaseStalePrs', - ':gitSignOff' + ':gitSignOff', + ':semanticCommitTypeAll(chore)' ], 'git-submodules': { enabled: true From 32ba80bab543b6c3f7dd41a6cb2ab1607e797878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20M=C3=B6ller?= Date: Thu, 21 Aug 2025 21:16:51 +0200 Subject: [PATCH 14/14] chore: update build flags in Taskfile for static linking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added `CGO_ENABLED=0` to disable CGO for a fully static binary. - Updated `-ldflags` to include `-extldflags=-static -w -s` for reducing binary size and ensuring static linking. Signed-off-by: Jakob Möller --- cli/Taskfile.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/Taskfile.yml b/cli/Taskfile.yml index 9b62974ab..b016834a5 100644 --- a/cli/Taskfile.yml +++ b/cli/Taskfile.yml @@ -76,8 +76,8 @@ tasks: - tmp/resources/ocm-{{ .GOOS }}-{{ .GOARCH }}.yaml cmds: - cmd: | - GOOS={{ .GOOS }} GOARCH={{ .GOARCH }} go build \ - -ldflags "-X ocm.software/open-component-model/cli/cmd/version.BuildVersion={{ .VERSION }}" \ + CGO_ENABLED=0 GOOS={{ .GOOS }} GOARCH={{ .GOARCH }} go build \ + -ldflags "-extldflags=-static -w -s -X ocm.software/open-component-model/cli/cmd/version.BuildVersion={{ .VERSION }}" \ -o {{ .TASKFILE_DIR }}/tmp/bin/ocm-{{ .GOOS }}-{{ .GOARCH }} - | mkdir -p {{ .TASKFILE_DIR }}/tmp/resources