Skip to content
Open
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
38 changes: 38 additions & 0 deletions .changeset/migrate-asdf-to-mise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
"setup-nodejs": minor
"ci-lint-ts": minor
"ci-test-ts": minor
"ci-test-sol": minor
"ci-prettier": minor
"cicd-build-publish-artifacts-ts": minor
"cicd-changesets": minor
"reusable-docusaurus": minor
"changesets-signed-commits": patch
---

Migrate version management from asdf/`.tool-versions` to
[mise](https://mise.jdx.dev/): versions are pinned in the repo root
`mise.toml`.

- `setup-nodejs` reads node and pnpm versions from a mise file (`mise.toml`,
`.mise.toml`, `.config/mise/config.toml`) first, falling back to
`.tool-versions`/`.nvmrc`, so downstream repos can migrate independently.
Consumer repos are not required to use either: repos with no version file
now get setup-node's default node and pnpm `^12.0.0` instead of failing (the
old action always passed `.tool-versions` to setup-node, which errors when
the file is missing). A new `node-version` input takes precedence over
`node-version-file`, which now defaults to auto-detect instead of
`.tool-versions`. When a mise config is present, `mise install` also
provisions every pinned tool (e.g. `shellcheck`) for later steps; opt out
with the new `mise-install` input.
- `ci-lint-ts`, `ci-test-ts`, `ci-test-sol`, `ci-prettier`,
`cicd-build-publish-artifacts-ts`, `cicd-changesets`, and
`reusable-docusaurus` default `node-version-file` to auto-detect and
`pnpm-version` to the version pinned in the repo's `mise.toml` or
`.tool-versions` (fallback `^12.0.0`). `ci-prettier`'s fallback node version
bumped from `^20.16.0` to `^26.0.0` and its default pnpm moved from `^9.0.0`
to the file-driven version.
- `signed-commits` README examples now pass `node-version-file: mise.toml`.

NOTE for consumers: repos pinning versions via `.tool-versions` keep working
unchanged. Pin versions in a `mise.toml` to pick up the new behavior.
6 changes: 6 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
"(^|/)action\\.ya?ml$"
]
},
"mise": {
"fileMatch": [
"(^|/)\\.?mise(\\.work)?\\.toml$",
"(^|/)\\.config/mise/config\\.toml$"
]
},
"packageRules": [
{
"groupName": "minor-patch dependencies grouped by manager",
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/changesets-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ jobs:

- name: Setup pnpm
uses: ./actions/setup-nodejs
with:
pnpm-version: "^12.0.0"

- name: Dry-run changeset version
env:
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/pull-request-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
with:
# general inputs
checkout-repo: "false"
pnpm-version: "^12.0.0"

ci-prettier:
runs-on: ubuntu-latest
Expand All @@ -41,7 +40,6 @@ jobs:
with:
# general inputs
checkout-repo: "false"
pnpm-version: "^12.0.0"

ci-lint-misc:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -128,7 +126,6 @@ jobs:
with:
# general inputs
checkout-repo: "false"
pnpm-version: "^12.0.0"

ci-build-artifacts:
runs-on: ubuntu-latest
Expand All @@ -145,7 +142,6 @@ jobs:
with:
# general inputs
checkout-repo: "false"
pnpm-version: "^12.0.0"

- name: Check for diff in built artifacts
run: |
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/push-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ jobs:
with:
# general inputs
checkout-repo: "false"
pnpm-version: "^12.0.0"

ci-prettier:
runs-on: ubuntu-latest
Expand All @@ -38,7 +37,6 @@ jobs:
with:
# general inputs
checkout-repo: "false"
pnpm-version: "^12.0.0"

ci-test:
runs-on: ubuntu-latest
Expand All @@ -55,7 +53,6 @@ jobs:
with:
# general inputs
checkout-repo: "false"
pnpm-version: "^12.0.0"

cicd-build-publish-artifacts-dev:
runs-on: ubuntu-latest
Expand All @@ -77,7 +74,6 @@ jobs:
uses: ./actions/cicd-build-publish-artifacts-ts
with:
checkout-repo: "false"
pnpm-version: "^12.0.0"

cd-release:
runs-on: ubuntu-latest
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/reusable-docusaurus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,19 @@ on:
inputs:
# nodejs inputs
node-version-file:
description: "path to .tool-versions file for node version"
description:
"path to a version file for node (mise.toml, .tool-versions,
.nvmrc); empty auto-detects"
required: false
type: string
default: ".tool-versions"
default: ""
pnpm-version:
description: "the pnpm version to use"
description:
"pnpm version; empty reads it from mise.toml/.tool-versions, falling
back to ^12.0.0"
required: false
type: string
default: "^12.0.0"
default: ""
# docs-specific inputs
build-command:
description: "command to build the documentation (run from repository root, use pnpm -C to specify directory)"
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/solidity-review-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ jobs:
uses: smartcontractkit/.github/actions/setup-nodejs@0b8d877a32bfa479b62ce70c1f6d2493a7c93fed # v0.0.0
with:
package-json-directory: ${{ inputs.contracts_directory }}
node-version-file: ""
pnpm-version: ^12.0.0

- name: Create code coverage directory
Expand Down Expand Up @@ -326,6 +327,7 @@ jobs:
uses: smartcontractkit/.github/actions/setup-nodejs@0b8d877a32bfa479b62ce70c1f6d2493a7c93fed # v0.0.0
with:
package-json-directory: ${{ inputs.contracts_directory }}
node-version-file: ""
pnpm-version: ^12.0.0

- name: Install Foundry
Expand Down Expand Up @@ -491,6 +493,7 @@ jobs:
uses: smartcontractkit/.github/actions/setup-nodejs@0b8d877a32bfa479b62ce70c1f6d2493a7c93fed # v0.0.0
with:
package-json-directory: ${{ inputs.contracts_directory }}
node-version-file: ""
pnpm-version: ^12.0.0

- name: Setup git top level directory
Expand Down
3 changes: 0 additions & 3 deletions .tool-versions

This file was deleted.

79 changes: 79 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Contributing

This document covers setting up this repository, creating and modifying actions,
and how versioning works.

- [Setup](#setup)
- [Dependencies](#dependencies)
- [Post-Install](#post-install)
- [Common Tasks](#common-tasks)
- [New Actions](#new-actions)
- [Existing Actions](#existing-actions)
- [Versioning](#versioning)

## Setup

### Dependencies <!-- omit in toc -->

- [`mise`](https://mise.jdx.dev/) - manages the `node`, `pnpm`, and `shellcheck`
versions pinned in the repo root [`mise.toml`](mise.toml)

### Post-Install <!-- omit in toc -->

- `mise install` - will install versions as per the `mise.toml` file
- `mise run install` - install all npm dependencies (`pnpm install`) and the git
pre-commit hook (`pnpm lefthook install`)
- `pnpm lefthook run pre-commit` - to run the pre-commit hook manually

### Common Tasks <!-- omit in toc -->

Common operations are available as mise tasks, runnable from anywhere in the
repo:

| Task | Description |
| ------------------------- | ---------------------------------------------- |
| `mise run lint` | Lint all projects |
| `mise run build` | Build all projects |
| `mise run test` | Test all projects |
| `mise run format` | Format all files with prettier |
| `mise run workflows:sync` | Sync reusable workflows into .github/workflows |

These delegate to the pnpm scripts in the root `package.json`, which can also be
invoked directly (`pnpm run lint`, etc.).

## New Actions

1. Generate the Action boilerplate
```sh
pnpm nx generate nx-chainlink:create-gh-action
```
2. Make your changes
3. Add a changeset for your new action (`pnpm changeset`)
4. Commit and open a PR

## Existing Actions

1. Modify the action as needed
2. Build the action if it is written in JS/TS
3. Add a changeset (`pnpm changeset`)
4. Commit and open a PR

## Versioning

Actions are versioned through an automated process managed by
[`changesets`](https://github.com/changesets/changesets). The process is as
follows:

1. You merge a change with a changeset file (in the `.changeset` directory)
1. Created through invoking `pnpm changeset`
2. Or through [`gocs`](https://github.com/smartcontractkit/gocs)
(`go install github.com/smartcontractkit/gocs/cmd/gocs@latest`)
2. A "Version packages" pull request will open or update
([ex](https://github.com/smartcontractkit/.github/pull/540)). This PR will
"consume" the changesets present in the default branch by:
1. Deleting the changeset files
2. Adding the changeset content to the respective changelogs
3. Bump the versions in the `package.json` according to the changeset
(patch/minor/major)
3. The "Version packages" PR gets merged, and the git tags for the actions'
versions will be created during CICD.
57 changes: 2 additions & 55 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ network of repositories.
- [Action Versions](#action-versions)
- [Automated Updates](#automated-updates)
- [Contributing](#contributing)
- [Setup](#setup)
- [New Actions](#new-actions)
- [Existing Actions](#existing-actions)
- [Versioning](#versioning)
- [Example Usage](#example-usage)

## Using Actions
Expand Down Expand Up @@ -44,57 +40,8 @@ or patch versions are released for the major version you are pinned to.

## Contributing

### Setup

#### Dependencies <!-- omit in toc -->

- [`asdf`](https://asdf-vm.com/)
- [`pnpm`](https://pnpm.io/)
- `nodejs`

#### Post-Install <!-- omit in toc -->

- `asdf install` - will install versions as per the `.tool-versions` file
- `pnpm install` - install all npm dependencies as required
- `pnpm lefthook install` - install the git pre-commit hook for formatting
- `pnpm lefthook run pre-commit` - to run the pre-commit hook manually

### New Actions

1. Generate the Action boilerplate
```sh
pnpm nx generate nx-chainlink:create-gh-action
```
2. Make your changes
3. Add a changeset for your new action (`pnpm changeset`)
4. Commit and open a PR

### Existing Actions

1. Modify the action as needed
2. Build the action if it is written in JS/TS
3. Add a changeset (`pnpm changeset`)
4. Commit and open a PR

### Versioning

Actions are versioned through an automated process managed by
[`changesets`](https://github.com/changesets/changesets). The process is as
follows:

1. You merge a change with a changeset file (in the `.changeset` directory)
1. Created through invoking `pnpm changeset`
2. Or through [`gocs`](https://github.com/smartcontractkit/gocs)
(`go install github.com/smartcontractkit/gocs/cmd/gocs@latest`)
2. A "Version packages" pull request will open or update
([ex](https://github.com/smartcontractkit/.github/pull/540)). This PR will
"consume" the changesets present in the default branch by:
1. Deleting the changeset files
2. Adding the changeset content to the respective changelogs
3. Bump the versions in the `package.json` according to the changeset
(patch/minor/major)
3. The "Version packages" PR gets merged, and the git tags for the actions'
versions will be created during CICD.
See [CONTRIBUTING.md](CONTRIBUTING.md) for how to set up this repository, create
and modify actions, and how versioning works.

## Example Usage

Expand Down
12 changes: 8 additions & 4 deletions actions/ci-lint-ts/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@ inputs:
default: main
# nodejs inputs
node-version-file:
description: ""
description:
"path to a version file for node (mise.toml, .tool-versions, .nvmrc);
empty auto-detects"
required: false
default: ".tool-versions"
default: ""
pnpm-version:
description: ""
description:
"pnpm version; empty reads it from mise.toml/.tool-versions, falling back
to ^12.0.0"
required: false
default: "^12.0.0"
default: ""

runs:
using: composite
Expand Down
19 changes: 12 additions & 7 deletions actions/ci-prettier/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,22 @@ inputs:
default: "0"
# nodejs inputs
node-version-file:
description: ""
description:
"path to a version file for node (mise.toml, .tool-versions, .nvmrc);
empty auto-detects"
required: false
default: ".tool-versions"
default: ""
nodejs-version:
description:
"NodeJS version used only if the node-version-file isn't provided"
"NodeJS version written to node-version-file when that file doesn't exist"
required: false
default: "^20.16.0"
default: "^26.0.0"
pnpm-version:
description: ""
description:
"pnpm version; empty reads it from mise.toml/.tool-versions, falling back
to ^12.0.0"
required: false
default: "^9.0.0"
default: ""

runs:
using: composite
Expand All @@ -40,7 +44,8 @@ runs:
with:
fetch-depth: ${{ inputs.checkout-repo-fetch-depth }}

- name: Create .tool-versions file if it doesn't exist
- name: Create version file if it doesn't exist
if: inputs.node-version-file != ''
shell: bash
run: |
if [ ! -f "${{ inputs.node-version-file }}" ]; then
Expand Down
Loading
Loading