Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 20 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,42 +17,51 @@ jobs:

steps:

- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
persist-credentials: true

- name: Use Node.js 20.x
uses: actions/setup-node@v6
- uses: actions/setup-node@v6
with:
node-version: 20.x
node-version: 24.x

- name: Install dependencies
id: npm-ci
run: npm ci

- name: "Yontrack configuration"
if: github.repository_owner == 'nemerosa' && vars.YONTRACK_URL != ''
id: yontrack-config
uses: nemerosa/ontrack-github-actions-cli-config@v1.2.0
uses: nemerosa/ontrack-github-actions-cli-config@v1.3.0
env:
YONTRACK_URL: ${{ vars.YONTRACK_URL }}
YONTRACK_TOKEN: ${{ secrets.YONTRACK_TOKEN }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Publication
id: npm-publish
- name: Semantic release
id: release
if: ${{ github.ref == 'refs/heads/main' }}
run: |
npx semantic-release
# Capture the version from the latest git tag created by semantic-release
VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
echo "version=$VERSION" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Tagging the Yontrack build
if: ${{ github.ref_name == 'main' && steps.npm-publish.outputs.version != '' }}
- name: Update floating major/minor tags
if: ${{ github.ref == 'refs/heads/main' && steps.release.outputs.version != '' }}
run: |
yontrack build set-property release ${{ steps.npm-publish.outputs.version }}
VERSION="${{ steps.release.outputs.version }}"
[[ "$VERSION" =~ ^v([0-9]+)\.([0-9]+)\.[0-9]+$ ]] || exit 0
MAJOR="v${BASH_REMATCH[1]}"
MINOR="v${BASH_REMATCH[1]}.${BASH_REMATCH[2]}"
git tag -f "$MAJOR" "$VERSION"
git tag -f "$MINOR" "$VERSION"
git push origin -f "$MAJOR" "$MINOR"

- name: Tagging the Yontrack build
if: ${{ github.ref_name == 'main' && steps.release.outputs.version != '' && vars.YONTRACK_URL != '' }}
run: yontrack build set-property release "${{ steps.release.outputs.version }}"
35 changes: 19 additions & 16 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
{
"branches": [
"main"
],
"branches": ["main"],
"plugins": [
["@semantic-release/commit-analyzer", {
"preset": "angular",
"releaseRules": [
{"type": "docs", "release": false},
{"type": "fix", "release": "patch"},
{"type": "feat", "release": "minor"},
{"type": "refactor", "release": "major"},
{"type": "release", "release": "patch"}
],
{ "breaking": true, "release": "major" },
{ "type": "feat", "release": "minor" },
{ "type": "refactor", "release": "major" },
{ "type": "fix", "release": "patch" },
{ "type": "perf", "release": "patch" },
{ "type": "chore", "release": "patch" },
{ "type": "docs", "release": "patch" },
{ "type": "style", "release": "patch" },
{ "type": "test", "release": "patch" },
{ "type": "build", "release": "patch" },
{ "type": "ci", "release": "patch" },
{ "type": "revert", "release": "patch" },
{ "type": "release", "release": "patch" }
]
}],
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
[
"@semantic-release/git",
{
"assets": ["CHANGELOG.md", "action.yml"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
["@semantic-release/git", {
"assets": ["CHANGELOG.md", "package.json", "package-lock.json", "*/action.yml"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}],
"@semantic-release/github"
]
}
44 changes: 44 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Commands

There is no build, test, or lint step for this repo — it contains no JavaScript source. Composite actions are YAML-only. Consumers reference subfolder paths directly:

```yaml
- uses: nemerosa/ontrack-github-actions-cli-library/ontrack-cli-workflow-build@v1
```

`npm install` is only used to install `semantic-release` for the release workflow.

## Architecture

This is a **container repository for composite GitHub Actions**. Each subfolder is its own action; consumers reference them by path:

- [`ontrack-cli-workflow-build/`](./ontrack-cli-workflow-build/) — links the current workflow run to an existing build in Yontrack. Internally chains `cli-install` (to install the binary) with a `yontrack build search` shell step.

Adding a new composite action: create `<name>/action.yml` (with `runs.using: composite`), add a sibling `<name>/README.md`, link it from the top-level `README.md`'s "Actions" list.

**Why no JS:** Composite actions don't need a Node runtime — they're orchestration glue. Each step inside `runs.steps` either invokes another action (`uses:`) or runs a shell command (`run:` with `shell: bash`). No bundling, no `dist/`, no esbuild.

**Why this repo gets light-touch upgrades:** The Wave 2 toolchain (Node 24, esbuild, ESLint 10, Jest, DI pattern) doesn't apply — there's no JS to apply it to. The Wave 3 upgrade is dep hygiene, release-config standardization, and bumping floating-tag references to other `@nemerosa` actions.

**Key files:**
- `ontrack-cli-workflow-build/action.yml` — the composite action's manifest. References `cli-install` for the actual binary install.
- `package.json` — only contains `semantic-release` devDeps (used by the release workflow).
- `.releaserc` — semantic-release config: standardized `releaseRules`, plus a `git` plugin that commits `CHANGELOG.md` and any modified action.yml files via the `*/action.yml` glob.
- `.github/workflows/ci.yml` — runs `semantic-release` on `main` pushes; updates floating major/minor tags after a successful release.

## Release process

Releases are automated via `semantic-release` (`.releaserc`). Commit messages follow Angular convention. Every conventional-commit type triggers at least a patch release; `feat` is minor; `refactor` and any commit with a `BREAKING CHANGE:` footer is major.

The CI workflow on `main`:
1. Runs `npm ci` (just to install semantic-release; nothing to lint/build/test).
2. Runs `npx semantic-release` — produces `vX.Y.Z` GitHub release; `@semantic-release/git` commits `CHANGELOG.md` and any action.yml updates.
3. Force-updates floating `vX` and `vX.Y` tags so consumers can pin to a major and ride patch updates.

## NPM registry

This repo's deps come from npmjs.com (the public registry). No GH Packages auth needed.
Loading