Release an over-the-air (OTA) update to a channel from GitHub Actions with the HotCodePush CLI.
Note
Store the token and the private-key as encrypted secrets, never in the workflow file. Pin the action to a fixed version such as @v0.3.1, since no moving major tag is kept.
Build the app's web assets, then release them to a channel:
name: Release
on:
push:
branches: [main]
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 22
- run: npm ci && npm run build
- uses: hotcodepush-team/release-action@v0.3.1 # x-release-please-version
with:
token: ${{ secrets.HOTCODEPUSH_TOKEN }}
private-key: ${{ secrets.HOTCODEPUSH_SIGNING_KEY }}
channel: productionOn React Native and Expo one run makes one release of one platform, so run the action once per platform, here as a matrix:
jobs:
release:
runs-on: ubuntu-latest
strategy:
matrix:
platform: [ios, android]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 22
- run: npm ci
- uses: hotcodepush-team/release-action@v0.3.1 # x-release-please-version
with:
token: ${{ secrets.HOTCODEPUSH_TOKEN }}
private-key: ${{ secrets.HOTCODEPUSH_SIGNING_KEY }}
channel: production
platform: ${{ matrix.platform }}Two steps in one job, one with platform: ios and one with platform: android, work the same way. Give each step its own id to read its outputs.
Every input:
- uses: hotcodepush-team/release-action@v0.3.1 # x-release-please-version
with:
# The channel, by id or name; hotcodepush.json's channel by default.
channel: ''
# The build to upload, the framework's build output by default: on React Native and Expo one platform's prepared bundle, Capacitor's webDir or Cordova's www.
path: ''
# A bundle already uploaded, by number or id; without it the build is uploaded first.
bundle: ''
# Release what this channel serves, by id or name, instead of a bundle or a build.
from-channel: ''
# The bundle's version label; the project's package.json version by default.
bundle-version: ''
# The platform the bundle serves, `ios` or `android`. Required on React Native and Expo unless `bundle` is set, since one run makes one release of one platform there. On Capacitor and Cordova it narrows the bundle, which serves both by default.
platform: ''
# The commit to record, over the detected one.
git-sha: ''
# The branch or tag to record, over the detected one.
git-ref: ''
# The commit message subject to record, over the detected one.
git-message: ''
# Detect no git provenance when `true`; the `git-*` inputs still apply.
no-git: ''
# The share of devices the release reaches, 0 to 100; 100 by default, the schedule's first percentage with `progression`.
rollout-percent: ''
# Widen the rollout step by step while the release stays healthy when `true`: 10, 50 and 100 percent by default, each step after at least an hour and 50 applied updates.
progression: ''
# The percentages the rollout widens through, rising, the last above the starting rollout, with `progression`; `10,50,100` by default.
progression-rollout-percents: ''
# The seconds a step lasts at least before the next one, with `progression`; 3600 by default.
progression-minimum-seconds: ''
# The applied updates each step needs before the next one, with `progression`; 50 by default.
progression-minimum-update-count: ''
# Devices apply the release at once and restart when `true`.
mandatory: ''
# The release notes; they ride the public index.
notes: ''
# The app versions served, a semver range such as `>=2.3.0 <3.0.0`.
binary-version: ''
# The OS versions served, a range such as `>=17`.
os-version: ''
# An attribute the app sets that the device must carry, `key=value`, one per line or comma-separated.
attribute: ''
# A device the release is limited to, by id, one per line or comma-separated.
device: ''
# What auto-pause does when a release fails too often: `pause`, `revoke`, `notify` or `none`.
failure-action: ''
# The failure percentage at which auto-pause acts.
failure-threshold-percent: ''
# The applied updates a release needs before auto-pause judges it.
failure-minimum-update-count: ''
# Validate and print the audience the release would reach when `true`; nothing is signed, uploaded or published, so no private key is needed.
dry-run: ''
# The app, by id or name, when no hotcodepush.json is found or another app is meant.
app: ''
# The organization, by id or name, when you belong to several.
organization: ''
# The hotcodepush.json to use, when it is not the nearest one up from the working directory.
config: ''
# The content of the private key file to sign with, as `signing-key create` wrote it.
private-key: ''
# The API the token belongs to; the production API by default.
api-url: ''
# The directory the CLI runs in.
# Default: `.`.
working-directory: ''
# The HotCodePush CLI version to run, or an npm package spec such as a tarball URL.
# Default: `0.4.1`.
cli-version: ''
# The HotCodePush API token.
# Required.
token: ''| Name | Description |
|---|---|
release |
The JSON the CLI printed: the created release, or on a dry run the channel's audience. |
release-id |
The id of the release; empty on a dry run. |
release-number |
The number of the release; empty on a dry run. |
channel-id |
The id of the channel. |
bundle-id |
The id of the bundle the release carries; empty on a dry run. |
bundle-number |
The number of the bundle the release carries; empty on a dry run. |
rollout-percent |
The rollout percentage of the release; empty on a dry run. |
- The runner needs Node.js 22 or later. The action runs the CLI with
npx, so addactions/setup-nodewhere the runner has an older Node.js. - The action reads the CLI's JSON with
jq, which GitHub-hosted runners have preinstalled. Install it on a self-hosted runner. - One run makes one release on one channel. To release the same bundle to a second channel, run the action again with
bundleset to the first release'sbundle-number, which uploads nothing. - On React Native and Expo,
platformis required unlessbundleis set, since one run makes one release of one platform there. Without it the CLI fails withmissing_parameter. attributeanddevicetake several values, one per line or comma-separated on one line. When a value contains a comma, use one line per value.- A dry run (
dry-run: 'true') signs, uploads and publishes nothing, so it needs noprivate-key. Use it on pull requests to check the release and see the audience it would reach. - The bundle's version label is the project's
package.jsonversion by default. Setbundle-version: ${{ github.sha }}to label each bundle with its commit instead. cli-versiontakes a CLI version or any npm package spec, such as a tarball URL.- The action writes a job summary with the release, or with the channel's audience on a dry run.
- When the CLI fails, the action annotates the run with the CLI's error code, message and fix, and exits with the CLI's exit code.
See GitHub Actions in the HotCodePush docs.
See LICENSE.