From b542a6aabf2d39549042656dbca929638168063c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Fri, 18 Sep 2026 13:45:40 +0100 Subject: [PATCH 1/4] action: test the output name against action.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit run() sets "cuectl-path" while action.yml declares "cue-path", so the declared output is never set. Assert the current broken name for now. Signed-off-by: Daniel Martí --- __tests__/run.test.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/__tests__/run.test.ts b/__tests__/run.test.ts index 67de888..5941147 100644 --- a/__tests__/run.test.ts +++ b/__tests__/run.test.ts @@ -20,6 +20,12 @@ import * as path from 'path'; import * as core from '@actions/core'; import * as util from 'util'; +// action.yml declares the outputs available to workflows, so run() must set +// exactly those names. Read it here, before any test mocks out fs. +const declaredOutputs = [...fs.readFileSync(path.join(__dirname, '..', 'action.yml'), 'utf8') + .match(/^outputs:\n(?:[ ].*\n)*/m)![0] + .matchAll(/^ ([\w-]+):$/gm)].map(m => m[1]); + describe('Testing all functions in run file.', () => { test('run() must download specified cuectl version and set output', async () => { jest.spyOn(core, 'getInput').mockReturnValue('v0.4.0'); @@ -33,6 +39,8 @@ describe('Testing all functions in run file.', () => { expect(await run.run()).toBeUndefined(); expect(core.getInput).toHaveBeenCalledWith('version', { 'required': true }); expect(core.addPath).toHaveBeenCalledWith('pathToCachedTool'); + expect(declaredOutputs).toEqual(['cue-path']); + // TODO: run() sets an output name which action.yml does not declare. expect(core.setOutput).toHaveBeenCalledWith('cuectl-path', path.join('pathToCachedTool', 'cue')); }); From 6b3ae74fb36a07b68505c05c611e6d2adae2f98c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Fri, 18 Sep 2026 13:46:06 +0100 Subject: [PATCH 2/4] action: set the "cue-path" output declared by action.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The rename in v1.0.0 only touched action.yml, so workflows had to read the undeclared "cuectl-path" instead. This is a breaking change for anyone doing so. Signed-off-by: Daniel Martí --- README.md | 4 ++-- __tests__/run.test.ts | 3 +-- dist/index.js | 2 +- src/run.ts | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1409ff0..ff2c87a 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ The input and output schemas are best described using CUE itself: #outputs: { // Path to the cached CUE binary - "cuectl-path": string + "cue-path": string } ``` @@ -35,7 +35,7 @@ Please refer to [`action.yml`](action.yml) for more details. The cached `cue` binary path is prepended to the `PATH` environment variable and can be executed directly in later workflow steps. It is also stored in the -`cuectl-path` output variable. +`cue-path` output variable. ## Issues/Discussions diff --git a/__tests__/run.test.ts b/__tests__/run.test.ts index 5941147..66d1ce0 100644 --- a/__tests__/run.test.ts +++ b/__tests__/run.test.ts @@ -40,8 +40,7 @@ describe('Testing all functions in run file.', () => { expect(core.getInput).toHaveBeenCalledWith('version', { 'required': true }); expect(core.addPath).toHaveBeenCalledWith('pathToCachedTool'); expect(declaredOutputs).toEqual(['cue-path']); - // TODO: run() sets an output name which action.yml does not declare. - expect(core.setOutput).toHaveBeenCalledWith('cuectl-path', path.join('pathToCachedTool', 'cue')); + expect(core.setOutput).toHaveBeenCalledWith('cue-path', path.join('pathToCachedTool', 'cue')); }); test('getExecutableExtension() must return .exe file extension when os equals Windows', () => { diff --git a/dist/index.js b/dist/index.js index 6e6fb5a..76b2d90 100644 --- a/dist/index.js +++ b/dist/index.js @@ -34118,7 +34118,7 @@ function run() { let cachedCuectlPath = yield downloadCuectl(version); core.addPath(path.dirname(cachedCuectlPath)); console.log(`CUE binary version: '${version}' has been cached at ${cachedCuectlPath}`); - core.setOutput('cuectl-path', cachedCuectlPath); + core.setOutput('cue-path', cachedCuectlPath); }); } if (require.main === require.cache[eval('__filename')]) { diff --git a/src/run.ts b/src/run.ts index bb92b83..a22e6dc 100644 --- a/src/run.ts +++ b/src/run.ts @@ -106,7 +106,7 @@ export async function run() { core.addPath(path.dirname(cachedCuectlPath)); console.log(`CUE binary version: '${version}' has been cached at ${cachedCuectlPath}`); - core.setOutput('cuectl-path', cachedCuectlPath); + core.setOutput('cue-path', cachedCuectlPath); } From 395e3a329bae9345ac5440cb6549f6da11f05238 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Fri, 18 Sep 2026 13:46:28 +0100 Subject: [PATCH 3/4] all: prepare for the v2.0.0 release MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Point the README at the v2 major tag, note the runner version needed by node24, and give package.json a real version. Signed-off-by: Daniel Martí --- README.md | 6 +++++- package.json | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ff2c87a..91c3388 100644 --- a/README.md +++ b/README.md @@ -11,12 +11,16 @@ the latest release of `cue`. Releases and pre-releases of `cue` are listed [here](https://github.com/cue-lang/cue/releases). ``` -- uses: cue-lang/setup-cue@v1.0.0 +- uses: cue-lang/setup-cue@v2 with: version: '' # default is latest id: install ``` +This action runs on Node 24, which requires Actions Runner v2.327.1 or later. +GitHub-hosted runners are new enough; self-hosted runners and GitHub Enterprise +Server installations may need updating. + The input and output schemas are best described using CUE itself: ```cue diff --git a/package.json b/package.json index 1fd50b6..29fafc6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "setup-cue", - "version": "0.0.0", + "version": "2.0.0", "description": "Install CUE on your runner using Github Actions", "main": "dist/index.js", "scripts": { From 4535863f0e1e0527aa689029b59dfcf788634956 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Fri, 18 Sep 2026 13:53:58 +0100 Subject: [PATCH 4/4] all: add CLAUDE.md with development and release notes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Martí --- CLAUDE.md | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..aeb9edd --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,61 @@ +# setup-cue + +A GitHub Action which installs a CUE release on a runner and adds it to `PATH`. +The action is TypeScript, bundled into a single JavaScript file which GitHub +runs directly from this repository. + +## Layout + + src/run.ts the action's implementation + __tests__/ jest tests + dist/index.js the bundle GitHub actually runs; generated, committed + action.cue the action definition; generates action.yml + workflows.cue the CI workflow definition; generates .github/workflows/ + *_tool.cue the cue commands which write the generated files + +`dist/index.js`, `action.yml` and `.github/workflows/*.yml` are all generated. +Never edit them by hand; change the source and re-run the generator below. + +## Developing + + npm ci + npm test + npm run dist # regenerate dist/index.js + cue cmd genaction # regenerate action.yml from action.cue + cue cmd genworkflows # regenerate .github/workflows from workflows.cue + +CI runs all of the above and then fails if the tree is dirty, so any commit +touching `src/` or a `.cue` file must include its regenerated output. + +Inputs and outputs are declared in `action.cue` and consumed by name in +`src/run.ts`; nothing enforces that the two agree at build time, so a test +reads the names back out of `action.yml`. Keep it that way. + +## Versioning + +Follow semver, and bump the major version whenever a workflow which worked on +the previous tag might stop working: + +* raising the node runtime in `action.cue`, since it requires a newer Actions + Runner than some self-hosted and Enterprise Server installations have +* renaming or removing an input or output +* dropping support for a CUE version or platform + +Each major version has a moving tag, `v1` and `v2`, pointing at the newest +release of that major. Users are expected to reference those rather than exact +tags. `v1` is pinned to v1.0.1 and runs on node20, which runners no longer +provide as of 2026-09-23; it is kept only so existing references resolve. + +## Releasing + +1. Check CI is green on `main`. +2. Update the README's `uses:` line and `package.json`'s version. +3. Tag the release and move the major tag: + + git tag -a vX.Y.Z -m vX.Y.Z && git push origin vX.Y.Z + git tag -f vX vX.Y.Z && git push -f origin vX + +4. Publish a GitHub release whose notes lead with anything breaking, naming + the runner version required if the node runtime changed. + +Issues and discussions live in the main cue-lang/cue repository, not here.