Skip to content

[bin-build] Update build process to conditionally copy jsdoc and depl… #20

[bin-build] Update build process to conditionally copy jsdoc and depl…

[bin-build] Update build process to conditionally copy jsdoc and depl… #20

name: CI | Publish cyberia npm package
on:
push:
tags:
- 'v*'
jobs:
build-and-publish:
# prevents this action from running on forks
if: github.repository == 'underpostnet/engine-cyberia'
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: '24.x'
registry-url: 'https://registry.npmjs.org'
- name: Install Dependencies
run: npm ci
- name: Publish to npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --provenance --access public
build-and-publish-ghpkg:
# prevents this action from running on forks
if: github.repository == 'underpostnet/engine-cyberia-ghpkg'
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: '24.x'
registry-url: 'https://registry.npmjs.org'
scope: '@underpostnet'
- name: Install Dependencies
run: npm ci
- name: Publish to npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --provenance --access public
- name: Setup node to publish to GitHub Packages
uses: actions/setup-node@v6
with:
node-version: '24.x'
registry-url: 'https://npm.pkg.github.com'
scope: '@underpostnet'
- name: Publish to GitHub Packages
run: |
npm config set //npm.pkg.github.com/:_authToken=${{ secrets.GIT_AUTH_TOKEN }}
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GIT_AUTH_TOKEN }}" > ~/.npmrc
echo "@underpostnet:registry=https://npm.pkg.github.com" >> ~/.npmrc
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GIT_AUTH_TOKEN }}