Skip to content

Publish to npm

Publish to npm #61

Workflow file for this run

name: Publish to npm
defaults:
run:
shell: bash
on: [workflow_dispatch]
jobs:
publish:
runs-on: ubuntu-latest
environment: upload
permissions:
id-token: write # Required by Akeyless
contents: read
packages: read
steps:
- name: Import Secrets
id: import-secrets
uses: LanceMcCarthy/akeyless-action@v3
with:
access-id: ${{ secrets.GH_AKEYLESS_ACCESS_ID }}
static-secrets: |
{
"/WebComponents/prod/tokens/GH_TOKEN": "GH_TOKEN",
"/WebComponents/prod/tokens/PROGRESS_NPM_REGISTRY_TOKEN": "NPM_TOKEN"
}
export-secrets-to-environment: false
- name: Check out master
uses: actions/checkout@v4
with:
ref: master
fetch-depth: 0 # Fetch all branches
token: ${{ steps.import-secrets.outputs.GH_TOKEN }}
- name: Setup git
run: |
git config user.name "kendo-bot"
git config user.email "[email protected]"
- name: Merge develop to master
run: |
git fetch --quiet
git reset --hard origin/master
git merge --ff-only --quiet origin/develop
- name: Setup node
uses: actions/setup-node@v4
with:
cache: 'npm'
node-version: 20.x
registry-url: 'https://registry.npmjs.org'
env:
NODE_AUTH_TOKEN: ${{ steps.import-secrets.outputs.NPM_TOKEN }}
- name: Install
run: |
npm ci
- name: Lerna publish
run: npx lerna publish --conventional-commits --conventional-graduate --create-release github --force-publish --exact
env:
GH_TOKEN: ${{ steps.import-secrets.outputs.GH_TOKEN }}
- name: Push to GitHub
run: |
git push origin master --tags --quiet > /dev/null 2>&1
git push origin master:develop --quiet > /dev/null 2>&1