Skip to content

Update new-publish.yml #25

Update new-publish.yml

Update new-publish.yml #25

Workflow file for this run

name: Node.js Package
on:
workflow_dispatch:
push:
branches:
- main
jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
- run: npm run build
# - run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
publish-github:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: https://npm.pkg.github.com/
scope: "@appsaeed" # Update the scope if necessary
- name: Read package name
id: get-package-name
run: echo "::set-output name=name::$(jq -r .name package.json)"
shell: bash
- name: Display package name
run: |
echo "Package name is: ${{ needs.get-package-name.outputs.name }}"
- run: npm config set registry https://npm.pkg.github.com
- run: npm run build
- run: npm publish --access public --name @appsaeed/${{ needs.get-package-name.outputs.name }}
# - run: npm publish npm publish --name @${github.repository_owner}/utilies
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}