Skip to content

Publish to NPM

Publish to NPM #148

Workflow file for this run

name: Publish to NPM
on:
workflow_dispatch:
inputs:
dry-run:
description: 'Do not touch or write anything, but show the commands'
default: true
type: boolean
jobs:
release-it:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 14.17.3
- name: Remove .npmrc
run: |
rm -f .npmrc
shell: bash
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11.5
- name: Install dependencies
run: |
npm install --agora_electron_publish_to_npm
shell: bash
- name: Setup NPM auth token
run: |
npm set "//registry.npmjs.org/:_authToken" ${{ secrets.NPM_TOKEN }}
- name: Dry Run Release
if: ${{ inputs.dry-run }}
run: |
npm publish --tag customer_hotfix --verbose --dry-run
- name: NPM Publish
if: ${{ !inputs.dry-run }}
run: |
git config --global user.email "${{ secrets.GIT_EMAIL }}"
git config --global user.name "${{ secrets.GIT_USERNAME }}"
npm publish --tag customer_hotfix --verbose