This repository contains reusable Github Actions to be used across our extensive network of repositories.
To use the actions in this repo you should will place the action reference in
the uses field of a Job step
(docs).
- uses: smartcontractkit/.github/actions/<action>@<commit> # <action>@<version>
This is a monorepo and all actions are versioned and tagged with the format
<action>/vX.Y.Z or w/ mutable major version tags <action>/vX. To find the
available versions, and corresponding commit for an action:
- Look at the repo's tags through Github UI: https://github.com/smartcontractkit/.github/tags
- Query the tags through CLI (faster)
git for-each-ref --format="%(objectname) %(refname:short)" refs/tags | grep "<action name>"
We recommend using the major version tags for actions stored within this repository. This ensures that all actions are automatically updated if new minor or patch versions are released for the major version you are pinned to.
asdf install- will install versions as per the.tool-versionsfilepnpm install- install all npm dependencies as requiredpnpm lefthook install- install the git pre-commit hook for formattingpnpm lefthook run pre-commit- to run the pre-commit hook manually
- Generate the Action boilerplate
pnpm nx generate nx-chainlink:create-gh-action
- Make your changes
- Add a changeset for your new action (
pnpm changeset) - Commit and open a PR
- Modify the action as needed
- Build the action if it is written in JS/TS
- Add a changeset (
pnpm changeset) - Commit and open a PR
Actions are versioned through an automated process managed by
changesets. The process is as
follows:
- You merge a change with a changeset file (in the
.changesetdirectory)- Created through invoking
pnpm changeset - Or through
gocs(go install github.com/smartcontractkit/gocs/cmd/gocs@latest)
- Created through invoking
- A "Version packages" pull request will open or update
(ex). This PR will
"consume" the changesets present in the default branch by:
- Deleting the changeset files
- Adding the changeset content to the respective changelogs
- Bump the versions in the
package.jsonaccording to the changeset (patch/minor/major)
- The "Version packages" PR gets merged, and the git tags for the actions' versions will be created during CICD.
Below are example "Golden Path" repositories that utilize these reuseable actions.
- Go application:
smartcontractkit/releng-go-app - Go library:
smartcontractkit/releng-go-lib - TypeScript application:
smartcontractkit/releng-ts-app - Solidity contracts:
smartcontractkit/releng-sol-contracts