Skip to content

Workflow file for this run

name: Publish package to GitHub Packages and NPM.js
on:
release:
types: [published]
jobs:
githubPackages:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
# Setup .npmrc file to publish to GitHub Packages
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: "20.x"
registry-url: "https://npm.pkg.github.com"
# Defaults to the user or organization that owns the workflow file
scope: "@fajarkim"
- run: npm ci
- run: npm publish --public
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
npmJs:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
# Setup .npmrc file to publish to NPM.js
- run: mv .npmrc.bak .npmrc
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
# Defaults to the user or organization that owns the workflow file
scope: "@fajarkim"
- run: sed -i "s@https://npm.pkg.github.com@https://registry.npmjs.org@g" package.json
- run: npm ci
- run: npm publish --public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}