Skip to content

0.0.1

0.0.1 #39

Workflow file for this run

name: Publish
on:
release:
types: [created]
jobs:
publish:
if: github.event_name == 'release' && github.event.action == 'created'
runs-on: ubuntu-latest
steps:
# Checkout the repository
- uses: actions/checkout@v2
# Set up Node.js environment
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "18"
registry-url: "https://registry.npmjs.org/"
# Enable Corepack
- name: Enable Corepack
run: corepack enable
# Use the correct Yarn version
- name: Use the correct Yarn version
run: corepack prepare [email protected] --activate
# Load .env file if it exists
- name: Load .env file if exists
run: |
if [ -f .env ]; then
set -a
source .env
set +a
fi
# Set Environment Variables with fallback to .env
- name: Set Environment Variables with fallback to .env
run: |
echo "NPM_READ_TOKEN=${{ secrets.NPM_READ_TOKEN || env.NPM_READ_TOKEN }}" >> $GITHUB_ENV
echo "NPM_PUBLISH_TOKEN=${{ secrets.NPM_PUBLISH_TOKEN || env.NPM_PUBLISH_TOKEN }}" >> $GITHUB_ENV
# Install dependencies
- name: Install dependencies
run: yarn install
# Set up .npmrc for authentication
- name: Set up .npmrc for authentication
run: |
echo "//registry.npmjs.org/:_authToken=${NPM_PUBLISH_TOKEN}" > ~/.npmrc
# Debug - Display .npmrc (optional)
- name: Debug - Display .npmrc
run: cat ~/.npmrc
continue-on-error: true
# Publish to npm
- name: Publish to npm
run: yarn publish --non-interactive --access public