Skip to content

File Structure Improved #8

File Structure Improved

File Structure Improved #8

Workflow file for this run

# .github/workflows/publish.yml
name: Publish to npm
on:
push:
branches:
- develop
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3
# Set up Node.js
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
registry-url: "https://registry.npmjs.org"
cache: "npm"
# Install dependencies
- name: Install dependencies
run: npm install
# Run tests (optional)
- name: Run tests
run: npm test
# Build the package
- name: Build the package
run: npm run build
# Prepare dist folder for publish
- name: Copy necessary files to dist
run: cp README.md LICENSE package.json dist/
# Publish dist folder to npm
- name: Publish dist folder to npm
run: cd dist && npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}