1ed3b13f0d
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
47 lines
1.5 KiB
YAML
47 lines
1.5 KiB
YAML
name: Publish to npm
|
|
on:
|
|
workflow_call:
|
|
secrets:
|
|
NPM_TOKEN:
|
|
required: true
|
|
outputs:
|
|
id:
|
|
description: "The npm package@version string we published"
|
|
value: ${{ jobs.npm.outputs.id }}
|
|
jobs:
|
|
npm:
|
|
name: Publish to npm
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
id: ${{ steps.npm-publish.outputs.id }}
|
|
steps:
|
|
- name: 🧮 Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: staging
|
|
|
|
- name: 🔧 Yarn cache
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
cache: "yarn"
|
|
registry-url: "https://registry.npmjs.org"
|
|
|
|
- name: 🔨 Install dependencies
|
|
run: "yarn install --frozen-lockfile"
|
|
|
|
- name: 🚀 Publish to npm
|
|
id: npm-publish
|
|
uses: JS-DevTools/npm-publish@19c28f1ef146469e409470805ea4279d47c3d35c # v3.1.1
|
|
with:
|
|
token: ${{ secrets.NPM_TOKEN }}
|
|
access: public
|
|
tag: next
|
|
ignore-scripts: false
|
|
|
|
- name: 🎖️ Add `latest` dist-tag to final releases
|
|
if: steps.npm-publish.outputs.id && !contains(steps.npm-publish.outputs.id, '-rc.')
|
|
run: npm dist-tag add "$release" latest
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
release: ${{ steps.npm-publish.outputs.id }}
|