Skip to content

Merge pull request #4 from DIG-Network/release/v0.0.1-alpha.5 #4

Merge pull request #4 from DIG-Network/release/v0.0.1-alpha.5

Merge pull request #4 from DIG-Network/release/v0.0.1-alpha.5 #4

Workflow file for this run

name: Build and Publish to npm
on:
push:
tags:
- "**"
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}
cancel-in-progress: true
jobs:
build-and-publish:
name: Build and Publish to npm
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "18.x"
- name: Install Dependencies
run: npm ci
- name: Build Project
run: npm run build
- name: Debug NPM_TOKEN
run: |
if [ -z "${NPM_TOKEN}" ]; then
echo "NPM_TOKEN is not set or is empty."
exit 1
else
echo "NPM_TOKEN is set."
echo "NPM_TOKEN length: ${#NPM_TOKEN}"
echo "NPM_TOKEN first 4 chars: ${NPM_TOKEN:0:4}**** (masked)"
fi
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish to npm
run: |
npm config set provenance true
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
npm publish --tag next --access public
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}