Actions for common tasks in Holochain repositories
All actions and reusable workflows in this repo can be referenced with three levels of stability:
| Ref | Example | Behaviour |
|---|---|---|
@main |
holochain/actions/mattermost-notify@main |
Latest development state. May include unreleased or breaking changes. |
@stable |
holochain/actions/mattermost-notify@stable |
Latest stable release. Moves forward on each new release. |
@vX.Y.Z |
holochain/actions/mattermost-notify@v1.15.0 |
A specific release. Never changes. |
For use in production, pin to a specific version tag or @stable.
Releases are created by running the
Release Actions
workflow from the main branch. Provide the new version number (e.g. 1.15.0)
as the input.
The workflow will:
- Reset the
stablebranch to the current state ofmain - Replace all internal
@mainaction references with@vX.Y.Z - Commit and force-push the
stablebranch - Create a GitHub release (which also creates the version tag)
Important
Internal action refs in .github/workflows/ must always use @main on
development branches. The PR check enforces this. The release workflow
handles pinning them to the release version.
Warning
The stable branch is reset to main upon every release meaning that it
does not contain a history of all releases. Instead, each release is kept by
the tag reference. Because of this, no manual changes should be made to the
stable branch as they will be dropped on the next release.
This repo provides two reusable workflows for releasing Node.js packages. They implement a two-step process:
- Prepare a release PR that bumps the version and generates the changelog using git-cliff.
- Publishes the release as an npm package and GitHub release once the prepare release PR is merged.
Determines the next version (via git-cliff or a
manual override), bumps the versions of all packages, generates a changelog,
and opens a release PR with the hra-release label.
jobs:
prepare:
uses: holochain/actions/.github/workflows/nodejs-prepare-release.yml@stable
with:
# required: URL to the git-cliff config to use, the usual one for Holochain projects is
cliff_config_url: https://raw.githubusercontent.com/holochain/release-integration/refs/heads/main/pre-1.0-cliff.toml
# force_version: "1.2.3" # optional: skip version auto-detection and set version to this
# node_version: "24" # default: 24
# package_manager: "npm" # default: npm. One of: npm, yarn, pnpm
# install_deps: false # default: false. Required by some process such as napi-rs projects
secrets:
GH_TOKEN: ${{ secrets.GH_TOKEN }} # Used to create the PR and trigger the CI workflows so must not use the default GitHub token.Runs on every push to main. If the triggering commit came from a PR with the
hra-release label, it installs dependencies, builds, publishes to npm, and
creates a GitHub release. Non-release merges are skipped automatically.
on:
push:
branches: [main]
jobs:
publish:
uses: holochain/actions/.github/workflows/nodejs-publish-release.yml@stable
with:
# node_version: "24" # default: 24
# package_manager: "npm" # default: npm. One of: npm, yarn, pnpm
# build_script: "build" # default: build
# workspace_main_package: "packages/pkg-1/package.json" # required for workspace projects
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # omit if using npm Trusted PublishersPre-release versions (those containing a - in the version string, e.g.
1.0.0-alpha.1) are published with the next tag on npm and marked as
pre-releases on GitHub.
For more complex workflows, the underlying composite actions can be used directly:
holochain/actions/nodejs-setup@stable— validates the package manager and sets up Node.js, optionally installing dependenciesholochain/actions/nodejs-build@stable— runs the build scriptholochain/actions/nodejs-publish@stable— checks the version, creates the GitHub release, and publishes to npm
Important
Currently, only npm is supported as the package manager for workspace projects.
- Root
package.jsonrequired: the workspace must have a rootpackage.jsonwith aworkspacesfield so the tooling can detect that it is a workspace project. workspace_main_package: the path to one package'spackage.json(e.g.packages/pkg-1/package.json) must be provided. This package'snameandversionare used to check whether the release has already been published to npm.- Shared version: all packages in the workspace are expected to share the
same version. The prepare workflow bumps all packages to the same version
using
npm version --workspaces <version-number>.
Composite action: mattermost-notify/action.yml
Inputs:
mattermost_url: base URL for Mattermost (defaults tohttps://chat.holochain.org)channel_id: target Mattermost channel ID. This can be obtained by clicking the "(i)" icon at the top right of an open channel.message: message text to postmattermost_personal_access_token: Mattermost personal access token with permission to post in the channel.
Example usage:
name: Notify Mattermost
on:
workflow_dispatch:
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Send Mattermost message
uses: holochain/actions/mattermost-notify@stable
with:
mattermost_url: https://chat.example.com
channel_id: your_channel_id
message: Hello from GitHub Actions
mattermost_personal_access_token: ${{ secrets.MATTERMOST_PERSONAL_ACCESS_TOKEN }}