Skip to content

Publish the package #13

Publish the package

Publish the package #13

Workflow file for this run

name: Publish the package
on:
workflow_dispatch:
inputs:
version:
description: Package version
required: true
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.10.0
registry-url: https://registry.npmjs.org
scope: '@chaocore'
- name: Corepack enable
run: corepack enable
- name: Installing dependencies
run: yarn
- name: All checks
run: yarn all:checks
- name: Build
run: yarn build
- name: Updating version
run: |
git config user.name $GITHUB_ACTOR
git config user.email $GITHUB_ACTOR@users.noreply.github.com
npm version ${{ github.event.inputs.version }}
- name: Deleting the postinstall script in package.json before publishing
run: npm pkg delete scripts.postinstall
- name: Publishing the package
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Pushing version and tag to repository
run: |
git push origin main
git push origin v${{ github.event.inputs.version }}