Files
huly-platform/.github/workflows/publish-npm.yml
T
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
fb596e91dc Bump actions/cache from 5 to 6 (#10925)
Bumps [actions/cache](https://github.com/actions/cache) from 5 to 6.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-12 08:32:47 +07:00

55 lines
1.7 KiB
YAML

name: Publish npm
on:
workflow_dispatch:
inputs:
ref:
description: 'Ref to publish (e.g. refs/tags/v0.7.382 or a branch)'
required: true
default: 'refs/heads/develop'
jobs:
publish-npm:
permissions:
contents: read
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v7
with:
ref: ${{ github.event.inputs.ref }}
fetch-depth: 0
- uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
- name: Cache node modules
uses: actions/cache@v6
env:
cache-name: cache-node-platform
with:
path: common/temp
key: ${{ runner.os }}-build-cache-node-platform-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-build-cache-node-platform-
- name: Installing...
run: node common/scripts/install-run-rush.js install
- name: Building...
run: node common/scripts/install-run-rush.js build
- name: Emit TypeScript declarations
run: node common/scripts/install-run-rush.js validate
- name: Publish to npm
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
if [ -z "$NPM_TOKEN" ]; then
echo "::error::NPM_TOKEN secret is not set. Add it in repository Settings > Secrets and variables > Actions."
exit 1
fi
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
REF="${{ github.event.inputs.ref }}"
VERSION="${REF#refs/tags/v}"
VERSION="${VERSION#v}"
if [[ "$REF" == refs/tags/v* ]]; then
node common/scripts/bump.js --check "$VERSION"
fi
node common/scripts/safe-publish.js